DORMANTno replies

[PATCH] rxrpc: key: use BUG_ON instead of if condition followed by BUG

From: Gustavo A. R. Silva <hidden>
Date: 2017-10-24 16:24:31
Also in: lkml
Subsystem: networking [general], rxrpc sockets (af_rxrpc), the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, David Howells, Marc Dionne, Linus Torvalds

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help