[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070418223339.GE13146@hovland.org>
Date: Wed, 18 Apr 2007 15:33:44 -0700
From: Erik Hovland <erik@...land.org>
To: netdev@...r.kernel.org
Cc: trivial@...nel.org
Subject: [PATCH] Make dev_kfree_skb_any check if the skb is valid
If dev_kfree_skb_any is called and it then calls dev_kfree_skb_irq.
That call will dereference the skb. If the skb is invalid, down the
drain we go.
This one-liner checks to see if the skb is valid as part of the
determination of whether to call dev_kfree_skb_irq.
Signed-off-by: Erik Hovland <erik@...land.org>
---
net/core/dev.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 4dc93cc..85f4a4c 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1131,7 +1131,7 @@ EXPORT_SYMBOL(__netif_rx_schedule);
void dev_kfree_skb_any(struct sk_buff *skb)
{
- if (in_irq() || irqs_disabled())
+ if (skb && (in_irq() || irqs_disabled()))
dev_kfree_skb_irq(skb);
else
dev_kfree_skb(skb);
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists