mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] state: hmac: fix error message that algo is displayed
@ 2016-01-14  9:52 Marc Kleine-Budde
  2016-01-18  7:25 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Marc Kleine-Budde @ 2016-01-14  9:52 UTC (permalink / raw)
  To: barebox; +Cc: kernel

This patch moves the error message about missing crypto support so that the
used crypto algo is printed. Without this patch the algo is always shown as a
NULL pointer.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 common/state.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/state.c b/common/state.c
index d1fa47ffa34e..3e95efd91168 100644
--- a/common/state.c
+++ b/common/state.c
@@ -1583,6 +1583,10 @@ static int state_backend_raw_file_init_digest(struct state *state, struct state_
 	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 @@ static int state_backend_raw_file_init_digest(struct state *state, struct state_
 		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;
-- 
2.6.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-01-18  7:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-14  9:52 [PATCH] state: hmac: fix error message that algo is displayed Marc Kleine-Budde
2016-01-18  7:25 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox