Skip to content

Commit 9899886

Browse files
myunghojdavem330
authored andcommitted
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: Myungho Jung <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5294b83 commit 9899886

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/core/dev.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2450,6 +2450,9 @@ void __dev_kfree_skb_irq(struct sk_buff *skb, enum skb_free_reason reason)
24502450
{
24512451
unsigned long flags;
24522452

2453+
if (unlikely(!skb))
2454+
return;
2455+
24532456
if (likely(atomic_read(&skb->users) == 1)) {
24542457
smp_rmb();
24552458
atomic_set(&skb->users, 0);

0 commit comments

Comments
 (0)