Skip to contentSkip to conversation

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

PATCH New Gustavo A. R. Silva 1 participant 1 message Oct 24, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rxrpc: key: use BUG_ON instead of if condition followed by BUG

Use BUG_ON instead of if condition followed by BUG.

This issue was detected with the help of Coccinelle.

---
 net/rxrpc/key.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/rxrpc/key.c +1 -2
index e7f6b88..b7cc1b1 100644
@@ -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");
Signature · 1 line
2.7.4