[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20210607091112.2766745-1-zhengyongjun3@huawei.com>
Date: Mon, 7 Jun 2021 17:11:12 +0800
From: Zheng Yongjun <zhengyongjun3@...wei.com>
To: <davem@...emloft.net>, <yoshfuji@...ux-ipv6.org>,
<dsahern@...nel.org>, <kuba@...nel.org>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
CC: Zheng Yongjun <zhengyongjun3@...wei.com>
Subject: [PATCH net-next] net: use BUG_ON instead of if condition followed by BUG
Use BUG_ON instead of if condition followed by BUG in ip_frag_next.
This issue was detected with the help of Coccinelle.
Signed-off-by: Zheng Yongjun <zhengyongjun3@...wei.com>
---
net/ipv4/ip_output.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index c3efc7d658f6..9d0a7e8beaa8 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -734,8 +734,7 @@ struct sk_buff *ip_frag_next(struct sk_buff *skb, struct ip_frag_state *state)
/*
* Copy a block of the IP datagram.
*/
- if (skb_copy_bits(skb, state->ptr, skb_transport_header(skb2), len))
- BUG();
+ BUG_ON(skb_copy_bits(skb, state->ptr, skb_transport_header(skb2), len));
state->left -= len;
/*
--
2.25.1
Powered by blists - more mailing lists