Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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=195289



Signed-off-by: default avatarMyungho Jung <mhjungk@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5294b830
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2450,6 +2450,9 @@ void __dev_kfree_skb_irq(struct sk_buff *skb, enum skb_free_reason reason)
{
	unsigned long flags;

	if (unlikely(!skb))
		return;

	if (likely(atomic_read(&skb->users) == 1)) {
		smp_rmb();
		atomic_set(&skb->users, 0);