diff mbox

econet: failed calls to skb_share_check() and pskb_may_pull() are kernel errors, so return NET_RX_BAD

Message ID 20090620193743.9d0efe8d.lk-netdev@lk-netdev.nosense.org
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Mark Smith June 20, 2009, 10:07 a.m. UTC
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@yahoo.com.au>


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;