Commit 9899886d authored by Myungho Jung's avatar Myungho Jung Committed by David S. Miller

net: core: Prevent from dereferencing null pointer when releasing SKB

Added NULL check to make __dev_kfree_skb_irq consistent with kfree
family of functions.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=195289Signed-off-by: default avatarMyungho Jung <mhjungk@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5294b830
...@@ -2450,6 +2450,9 @@ void __dev_kfree_skb_irq(struct sk_buff *skb, enum skb_free_reason reason) ...@@ -2450,6 +2450,9 @@ void __dev_kfree_skb_irq(struct sk_buff *skb, enum skb_free_reason reason)
{ {
unsigned long flags; unsigned long flags;
if (unlikely(!skb))
return;
if (likely(atomic_read(&skb->users) == 1)) { if (likely(atomic_read(&skb->users) == 1)) {
smp_rmb(); smp_rmb();
atomic_set(&skb->users, 0); atomic_set(&skb->users, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment