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

* Re: [PATCH] state: hmac: fix error message that algo is displayed
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2016-01-18  7:25 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: barebox, kernel

On Thu, Jan 14, 2016 at 10:52:54AM +0100, Marc Kleine-Budde wrote:
> 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(-)

Applied, thanks

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
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