All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Krzysztof Halasa <khc@pm.waw.pl>
Cc: Adrian Bunk <bunk@kernel.org>, netdev@vger.kernel.org
Subject: Re: wan/hdlc_x25.c: fix a NULL dereference
Date: Sat, 13 Sep 2008 15:56:07 -0400	[thread overview]
Message-ID: <48CC1AD7.6000909@garzik.org> (raw)
In-Reply-To: <m37i9tkxnf.fsf_-_@maximus.localdomain>

Krzysztof Halasa wrote:
> 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;

applied



      reply	other threads:[~2008-09-13 19:56 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
2008-09-13 19:56         ` Jeff Garzik [this message]

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=48CC1AD7.6000909@garzik.org \
    --to=jeff@garzik.org \
    --cc=bunk@kernel.org \
    --cc=khc@pm.waw.pl \
    --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 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.