netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: jarkao2@gmail.com
Cc: error27@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [patch] hamradio: avoid null deref
Date: Wed, 23 Dec 2009 13:32:36 -0800 (PST)	[thread overview]
Message-ID: <20091223.133236.104065227.davem@davemloft.net> (raw)
In-Reply-To: <4B3257C2.2050500@gmail.com>

From: Jarek Poplawski <jarkao2@gmail.com>
Date: Wed, 23 Dec 2009 18:47:46 +0100

> 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.

And that is definitely the intent of the code here, to
bump the statistic in the original device object.

  reply	other threads:[~2009-12-23 21:32 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
2009-12-23 21:32   ` David Miller [this message]
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=20091223.133236.104065227.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=error27@gmail.com \
    --cc=jarkao2@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).