From: Gustavo A. R. Silva Date: Mon, 23 Oct 2017 18:10:56 +0000 (-0500) Subject: ipv4: tcp_minisocks: use BUG_ON instead of if condition followed by BUG X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=49ca1943a7adb429b11b8e05d81bc821694b76c7;p=openwrt%2Fstaging%2Fblogic.git ipv4: tcp_minisocks: use BUG_ON instead of if condition followed by BUG Use BUG_ON instead of if condition followed by BUG in tcp_time_wait. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller --- diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 2341b9f857b6..a952357054f4 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -298,8 +298,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo) key = tp->af_specific->md5_lookup(sk, sk); if (key) { tcptw->tw_md5_key = kmemdup(key, sizeof(*key), GFP_ATOMIC); - if (tcptw->tw_md5_key && !tcp_alloc_md5sig_pool()) - BUG(); + BUG_ON(tcptw->tw_md5_key && !tcp_alloc_md5sig_pool()); } } while (0); #endif