diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c index b89e3e95bffc0f50d477e86959f2bb42af9dce46..41cac0e4834e82fc33de1e369fb1e640bc7b7d59 100644 --- a/net/core/drop_monitor.c +++ b/net/core/drop_monitor.c @@ -517,7 +517,7 @@ static void net_dm_packet_trace_kfree_skb_hit(void *ignore, if (!nskb) return; - if ((unsigned int)reason >= SKB_DROP_REASON_MAX) + if (unlikely(reason >= SKB_DROP_REASON_MAX || reason <= 0)) reason = SKB_DROP_REASON_NOT_SPECIFIED; cb = NET_DM_SKB_CB(nskb); cb->reason = reason;