From: Jakub Kicinski Date: Wed, 11 May 2022 17:23:05 +0000 (-0700) Subject: skbuff: replace a BUG_ON() with the new DEBUG_NET_WARN_ON_ONCE() X-Git-Tag: baikal/mips/sdk6.1~5698^2~131 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=5ec7d260f254c8513ed6e7ae5477146a1f8ff3fa;p=kernel.git skbuff: replace a BUG_ON() with the new DEBUG_NET_WARN_ON_ONCE() Very few drivers actually have Kconfig knobs for adding -DDEBUG. 8 according to a quick grep, while there are 93 users of skb_checksum_none_assert(). Switch to the new DEBUG_NET_WARN_ON_ONCE() to catch bad skbs. Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20220511172305.1382810-1-kuba@kernel.org Signed-off-by: Jakub Kicinski --- diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index b91d225fdc134..9d82a8b6c8f16 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -5048,9 +5048,7 @@ static inline void skb_forward_csum(struct sk_buff *skb) */ static inline void skb_checksum_none_assert(const struct sk_buff *skb) { -#ifdef DEBUG - BUG_ON(skb->ip_summed != CHECKSUM_NONE); -#endif + DEBUG_NET_WARN_ON_ONCE(skb->ip_summed != CHECKSUM_NONE); } bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off);