[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20090620193743.9d0efe8d.lk-netdev@lk-netdev.nosense.org>
Date: Sat, 20 Jun 2009 19:37:43 +0930
From: Mark Smith <lk-netdev@...netdev.nosense.org>
To: netdev@...r.kernel.org, davem@...emloft.net
Subject: [PATCH] econet: failed calls to skb_share_check() and
pskb_may_pull() are kernel errors, so return NET_RX_BAD
As per the following #define and comment in netdevice.h,
#define NET_RX_BAD 5 /* packet dropped due to kernel error */
return NET_RX_BAD when skb_share_check() or pskb_may_pull() fail in
econet_rcv().
Signed-off-by: Mark Smith <markzzzsmith@...oo.com.au>
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c
index 6f479fa..b363ac5 100644
--- a/net/econet/af_econet.c
+++ b/net/econet/af_econet.c
@@ -1072,10 +1072,12 @@ static int econet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet
goto drop;
if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)
- return NET_RX_DROP;
+ return NET_RX_BAD;
- if (!pskb_may_pull(skb, sizeof(struct ec_framehdr)))
- goto drop;
+ if (!pskb_may_pull(skb, sizeof(struct ec_framehdr))) {
+ kfree_skb(skb);
+ return NET_RX_BAD;
+ }
hdr = (struct ec_framehdr *) skb->data;
--
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