From: Krzysztof Halasa <khc@pm.waw.pl>
To: Jeff Garzik <jeff@garzik.org>
Cc: Adrian Bunk <bunk@kernel.org>, netdev@vger.kernel.org
Subject: Re: wan/hdlc_x25.c: fix a NULL dereference
Date: Wed, 03 Sep 2008 18:21:56 +0200 [thread overview]
Message-ID: <m37i9tkxnf.fsf_-_@maximus.localdomain> (raw)
In-Reply-To: <m3bpz5kxzj.fsf@maximus.localdomain> (Krzysztof Halasa's message of "Wed\, 03 Sep 2008 18\:14\:40 +0200")
WAN: fixes a NULL dereference in hdlc_x25.
Reported-by: Adrian Bunk <bunk@kernel.org>.
Signed-off-by: Krzysztof Halasa <khc@pm.waw.pl>
diff --git a/drivers/net/wan/hdlc_x25.c b/drivers/net/wan/hdlc_x25.c
index 8b7e5d2..cbcbf6f 100644
--- a/drivers/net/wan/hdlc_x25.c
+++ b/drivers/net/wan/hdlc_x25.c
@@ -163,15 +163,17 @@ static void x25_close(struct net_device *dev)
static int x25_rx(struct sk_buff *skb)
{
+ struct net_device *dev = skb->dev;
+
if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) {
- skb->dev->stats.rx_dropped++;
+ dev->stats.rx_dropped++;
return NET_RX_DROP;
}
- if (lapb_data_received(skb->dev, skb) == LAPB_OK)
+ if (lapb_data_received(dev, skb) == LAPB_OK)
return NET_RX_SUCCESS;
- skb->dev->stats.rx_errors++;
+ dev->stats.rx_errors++;
dev_kfree_skb_any(skb);
return NET_RX_DROP;
}
next prev parent reply other threads:[~2008-09-03 16:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-27 22:05 [2.6 patch] wan/hdlc_x25.c: fix a NULL dereference Adrian Bunk
2008-08-29 7:08 ` Herbert Xu
2008-08-31 17:08 ` Krzysztof Halasa
2008-09-03 14:12 ` Jeff Garzik
2008-09-03 16:14 ` Krzysztof Halasa
2008-09-03 16:21 ` Krzysztof Halasa [this message]
2008-09-13 19:56 ` Jeff Garzik
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=m37i9tkxnf.fsf_-_@maximus.localdomain \
--to=khc@pm.waw.pl \
--cc=bunk@kernel.org \
--cc=jeff@garzik.org \
--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).