diff --git a/common/state.c b/common/state.c index d1fa47f..3e95efd 100644 --- a/common/state.c +++ b/common/state.c @@ -1583,6 +1583,10 @@ if (!p) /* does not exist */ return 0; + ret = of_property_read_string(state->root, "algo", &algo); + if (ret) + return ret; + if (!IS_ENABLED(CONFIG_STATE_CRYPTO)) { dev_err(&state->dev, "algo %s specified, but crypto support for state framework (CONFIG_STATE_CRYPTO) not enabled.\n", @@ -1590,10 +1594,6 @@ return -EINVAL; } - ret = of_property_read_string(state->root, "algo", &algo); - if (ret) - return ret; - ret = keystore_get_secret(state->name, &key, &key_len); if (ret == -ENOENT) /* -ENOENT == does not exist */ return -EPROBE_DEFER;