All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] econet: failed calls to skb_share_check() and pskb_may_pull() are kernel errors, so return NET_RX_BAD
@ 2009-06-20 10:07 Mark Smith
  0 siblings, 0 replies; only message in thread
From: Mark Smith @ 2009-06-20 10:07 UTC (permalink / raw)
  To: netdev, davem

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>


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;
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-06-20 10:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-20 10:07 [PATCH] econet: failed calls to skb_share_check() and pskb_may_pull() are kernel errors, so return NET_RX_BAD Mark Smith

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.