netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Smith <lk-netdev@lk-netdev.nosense.org>
To: netdev@vger.kernel.org, davem@davemloft.net
Subject: [PATCH] econet: have failed ec_queue_packet() call return NET_RX_BAD
Date: Sat, 20 Jun 2009 20:04:38 +0930	[thread overview]
Message-ID: <20090620200438.b5443520.lk-netdev@lk-netdev.nosense.org> (raw)

econet_rcv() calls ec_queue_packet(). The return from ec_queue_packet()
is the direct result of a call to sock_queue_rcv_skb(). Error returns
from ec_queue_packet() and therefore sock_queue_rcv_skb() are due to
kernel errors, so have econet_rcv() return NET_RX_BAD in this case.

If my understanding is correct, then

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..07f0f90 100644
--- a/net/econet/af_econet.c
+++ b/net/econet/af_econet.c
@@ -1092,8 +1092,10 @@ static int econet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet
 		goto drop;
 
 	if (ec_queue_packet(sk, skb, edev->net, hdr->src_stn, hdr->cb,
-			    hdr->port))
-		goto drop;
+			    hdr->port)) {
+		kfree_skb(skb);
+		return NET_RX_BAD;
+	}
 
 	return 0;
 


             reply	other threads:[~2009-06-20 10:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-20 10:34 Mark Smith [this message]
2009-06-20 10:53 ` [PATCH] econet: have failed ec_queue_packet() call return NET_RX_BAD Florian Westphal
2009-06-20 11:20   ` Mark Smith
2009-06-22  5:50     ` David Miller
2009-06-22  6:50       ` Mark Smith
2009-07-06  2:47   ` David Miller
2009-07-06 10:32     ` Mark Smith
2009-07-06 18:48       ` David Miller
2009-07-06 21:07         ` Mark Smith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090620200438.b5443520.lk-netdev@lk-netdev.nosense.org \
    --to=lk-netdev@lk-netdev.nosense.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).