* [PATCH net-next] net: use BUG_ON instead of if condition followed by BUG
@ 2021-06-07 9:11 Zheng Yongjun
0 siblings, 0 replies; only message in thread
From: Zheng Yongjun @ 2021-06-07 9:11 UTC (permalink / raw)
To: davem, yoshfuji, dsahern, kuba, netdev, linux-kernel; +Cc: Zheng Yongjun
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@huawei.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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-07 8:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-07 9:11 [PATCH net-next] net: use BUG_ON instead of if condition followed by BUG Zheng Yongjun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).