Message ID | 1615952318-4861-1-git-send-email-jiapeng.chong@linux.alibaba.com (mailing list archive) |
---|---|
State | Awaiting Upstream |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | rxrpc: rxkad: replace if (cond) BUG() with BUG_ON() | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Guessed tree name to be net-next |
netdev/subject_prefix | warning | Target tree name not specified in the subject |
netdev/cc_maintainers | success | CCed 5 of 5 maintainers |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 0 this patch: 0 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | warning | CHECK: Alignment should match open parenthesis WARNING: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 0 this patch: 0 |
netdev/header_inline | success | Link |
On Wed, Mar 17, 2021 at 11:38:38AM +0800, Jiapeng Chong wrote: > Fix the following coccicheck warnings: > > ./net/rxrpc/rxkad.c:1140:2-5: WARNING: Use BUG_ON instead of if > condition followed by BUG. > > Reported-by: Abaci Robot <abaci@linux.alibaba.com> > Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> > --- > net/rxrpc/rxkad.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c > index e2e9e9b..bfa3d9a 100644 > --- a/net/rxrpc/rxkad.c > +++ b/net/rxrpc/rxkad.c > @@ -1135,9 +1135,8 @@ static void rxkad_decrypt_response(struct rxrpc_connection *conn, > ntohl(session_key->n[0]), ntohl(session_key->n[1])); > > mutex_lock(&rxkad_ci_mutex); > - if (crypto_sync_skcipher_setkey(rxkad_ci, session_key->x, > - sizeof(*session_key)) < 0) > - BUG(); > + BUG_ON(crypto_sync_skcipher_setkey(rxkad_ci, session_key->x, > + sizeof(*session_key)) < 0); It will be better to delete this BUG_ON() or find a way to ensure that it doesn't happen and delete after that. Thanks > > memcpy(&iv, session_key, sizeof(iv)); > > -- > 1.8.3.1 >
diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c index e2e9e9b..bfa3d9a 100644 --- a/net/rxrpc/rxkad.c +++ b/net/rxrpc/rxkad.c @@ -1135,9 +1135,8 @@ static void rxkad_decrypt_response(struct rxrpc_connection *conn, ntohl(session_key->n[0]), ntohl(session_key->n[1])); mutex_lock(&rxkad_ci_mutex); - if (crypto_sync_skcipher_setkey(rxkad_ci, session_key->x, - sizeof(*session_key)) < 0) - BUG(); + BUG_ON(crypto_sync_skcipher_setkey(rxkad_ci, session_key->x, + sizeof(*session_key)) < 0); memcpy(&iv, session_key, sizeof(iv));
Fix the following coccicheck warnings: ./net/rxrpc/rxkad.c:1140:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> --- net/rxrpc/rxkad.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)