OSDN Git Service
(root)
/
uclinux-h8
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5294b83
)
net: core: Prevent from dereferencing null pointer when releasing SKB
author
Myungho Jung
<mhjungk@gmail.com>
Tue, 25 Apr 2017 18:58:15 +0000
(11:58 -0700)
committer
David S. Miller
<davem@davemloft.net>
Wed, 26 Apr 2017 18:47:14 +0000
(14:47 -0400)
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 <mhjungk@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c
patch
|
blob
|
history
diff --git
a/net/core/dev.c
b/net/core/dev.c
index
533a6d6
..
9b58753
100644
(file)
--- 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 (unlikely(!skb))
+ return;
+
if (likely(atomic_read(&skb->users) == 1)) {
smp_rmb();
atomic_set(&skb->users, 0);