Linux cryptographic layer development
 help / color / mirror / Atom feed
* [PATCH] crypto: n2_core: insert '!err' condition in else scope
@ 2013-10-19 13:09 Geyslan G. Bem
  2013-10-19 22:38 ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Geyslan G. Bem @ 2013-10-19 13:09 UTC (permalink / raw)
  To: kernel-br
  Cc: Geyslan G. Bem, Herbert Xu, David S. Miller, open list:CRYPTO API,
	open list

This patch moves the '!err' condition into the above else scope,
what is more obvious and has the secondary goal of avoid false-positives
in statical analyze tools.

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
---
 drivers/crypto/n2_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/n2_core.c b/drivers/crypto/n2_core.c
index e1f0ab4..afc6983 100644
--- a/drivers/crypto/n2_core.c
+++ b/drivers/crypto/n2_core.c
@@ -1511,9 +1511,9 @@ static int __n2_register_one_ahash(const struct n2_hash_tmpl *tmpl)
 		kfree(p);
 	} else {
 		pr_info("%s alg registered\n", base->cra_name);
+		if (p->hmac_type != AUTH_TYPE_RESERVED)
+			err = __n2_register_one_hmac(p);
 	}
-	if (!err && p->hmac_type != AUTH_TYPE_RESERVED)
-		err = __n2_register_one_hmac(p);
 	return err;
 }
 
-- 
1.8.4

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

end of thread, other threads:[~2013-10-20 12:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-19 13:09 [PATCH] crypto: n2_core: insert '!err' condition in else scope Geyslan G. Bem
2013-10-19 22:38 ` David Miller
2013-10-19 22:42   ` Geyslan Gregório Bem
2013-10-19 22:49     ` David Miller
2013-10-19 23:13       ` Geyslan Gregório Bem
2013-10-20 12:12         ` Herbert Xu

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