netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarek Poplawski <jarkao2@gmail.com>
To: Dan Carpenter <error27@gmail.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [patch] hamradio: avoid null deref
Date: Wed, 23 Dec 2009 18:47:46 +0100	[thread overview]
Message-ID: <4B3257C2.2050500@gmail.com> (raw)
In-Reply-To: <20091223132550.GD17923@bicker>

Dan Carpenter wrote, On 12/23/2009 02:25 PM:

> If dev == NULL we shouldn't dereference it.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> --- orig/drivers/net/hamradio/bpqether.c	2009-12-22 23:58:56.000000000 +0200
> +++ devel/drivers/net/hamradio/bpqether.c	2009-12-22 23:59:46.000000000 +0200
> @@ -283,7 +283,6 @@ static netdev_tx_t bpq_xmit(struct sk_bu
>  	bpq = netdev_priv(dev);
>  
>  	if ((dev = bpq_get_ether_dev(dev)) == NULL) {
> -		dev->stats.tx_dropped++;

Why not use a separate variable for another dev? This stat
should be helpful for debugging.

Jarek P.

>  		kfree_skb(skb);
>  		return NETDEV_TX_OK;
>  	}

  reply	other threads:[~2009-12-23 17:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-23 13:25 [patch] hamradio: avoid null deref Dan Carpenter
2009-12-23 17:47 ` Jarek Poplawski [this message]
2009-12-23 21:32   ` David Miller
2009-12-26 12:38   ` [patch] hamradio: avoid null deref v2 Dan Carpenter
2009-12-27  4:17     ` David Miller
2009-12-28 16:54       ` [patch] hamradio: avoid null deref v3 Dan Carpenter
2010-01-04  5:44         ` David Miller

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=4B3257C2.2050500@gmail.com \
    --to=jarkao2@gmail.com \
    --cc=error27@gmail.com \
    --cc=linux-kernel@vger.kernel.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).