Message ID | 1896493.H38pOMoCHn@debian64 (mailing list archive) |
---|---|
State | RFC |
Delegated to: | Kalle Valo |
Headers | show |
On Mon, Apr 10, 2017 at 2:22 PM, Christian Lamparter <chunkeey@googlemail.com> wrote: > Well, the patch could be as simple as this: > --- > diff --git a/net/core/dev.c b/net/core/dev.c > index 7869ae3837ca..44f7d5a1c67c 100644 > --- a/net/core/dev.c > +++ b/net/core/dev.c > @@ -2450,6 +2450,9 @@ void __dev_kfree_skb_irq(struct sk_buff *skb, enum skb_free_reason reason) > { > unsigned long flags; > > + if (!skb) > + return; > + > if (likely(atomic_read(&skb->users) == 1)) { > smp_rmb(); > atomic_set(&skb->users, 0); > --- > > The question is: would David or Eric support the change. Any comments, > what's the prefered solution? Just patch __dev_kfree_skb_irq to make > it consistent with *kfree*, or patch the driver? I'm fine either way, > but I would prefere patching __dev_kfree_skb_irq. This is fine, same check happens in consume_skb()
diff --git a/net/core/dev.c b/net/core/dev.c index 7869ae3837ca..44f7d5a1c67c 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2450,6 +2450,9 @@ void __dev_kfree_skb_irq(struct sk_buff *skb, enum skb_free_reason reason) { unsigned long flags; + if (!skb) + return; + if (likely(atomic_read(&skb->users) == 1)) { smp_rmb(); atomic_set(&skb->users, 0);