* [PATCH] rxrpc: key: use BUG_ON instead of if condition followed by BUG
@ 2017-10-24 16:24 Gustavo A. R. Silva
0 siblings, 0 replies; only message in thread
From: Gustavo A. R. Silva @ 2017-10-24 16:24 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, linux-kernel, Gustavo A. R. Silva
Use BUG_ON instead of if condition followed by BUG.
This issue was detected with the help of Coccinelle.
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
net/rxrpc/key.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/rxrpc/key.c b/net/rxrpc/key.c
index e7f6b88..b7cc1b1 100644
--- a/net/rxrpc/key.c
+++ b/net/rxrpc/key.c
@@ -851,8 +851,7 @@ static int rxrpc_preparse_s(struct key_preparsed_payload *prep)
return PTR_ERR(ci);
}
- if (crypto_skcipher_setkey(ci, prep->data, 8) < 0)
- BUG();
+ BUG_ON(crypto_skcipher_setkey(ci, prep->data, 8) < 0);
prep->payload.data[0] = ci;
_leave(" = 0");
--
2.7.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-10-24 16:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-24 16:24 [PATCH] rxrpc: key: use BUG_ON instead of if condition followed by BUG Gustavo A. R. Silva
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).