public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Jesper Juhl <jesper.juhl@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Valerie Henson <val@nmt.edu>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	tulip-users@lists.sourceforge.net,
	Kyle McMartin <kyle@mcmartin.ca>,
	david@lang.hm, Grant Grundler <grundler@parisc-linux.org>
Subject: Re: [PATCH][RESEND] Semi-pointless NULL test in uli526x driver
Date: Tue, 07 Aug 2007 17:23:10 -0400	[thread overview]
Message-ID: <46B8E2BE.1050408@garzik.org> (raw)
In-Reply-To: <200708042032.12317.jesper.juhl@gmail.com>

Jesper Juhl wrote:
> (resending previously submitted patch from 16/7-2007 22:40)
> 
> 
> Hi,
> 
> In drivers/net/tulip/uli526x.c::uli526x_interrupt() there's a test 
> of the function argument 'void *dev_id' against NULL. But that 
> test is pretty pointless, since if ever 'dev_id' is NULL we'll 
> already have crashed inside "netdev_priv(dev)".
> 
> I don't think dev_id can ever actually be NULL, so the whole block 
> inside "if (!dev) {" could probably just go away. But I guess 
> there's a good reason someone put that ULI526X_DBUG() in there - and
> if 'dev_id' /can/ actually be NULL then it's nice to have and in 
> that case this patch actually fixes a possible crash (hence the 
> version number update). 
> So I guess that in this case we should just move the 
> "db = netdev_priv(dev)" assignment past that NULL test. That's what 
> this patch does.
> 
> Found by the Coverity checker.
> Compile tested.
> 
> 
> PS. Please keep me on Cc when replying.
> 
> 
> Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>

Just remove the dev==NULL test...

Thanks,

	Jeff




  parent reply	other threads:[~2007-08-07 21:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-04 18:32 [PATCH][RESEND] Semi-pointless NULL test in uli526x driver Jesper Juhl
2007-08-04 21:14 ` Kyle McMartin
2007-08-07 21:23 ` Jeff Garzik [this message]
2007-08-07 21:28   ` Jesper Juhl
2007-08-07 21:32     ` 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=46B8E2BE.1050408@garzik.org \
    --to=jeff@garzik.org \
    --cc=akpm@linux-foundation.org \
    --cc=david@lang.hm \
    --cc=grundler@parisc-linux.org \
    --cc=jesper.juhl@gmail.com \
    --cc=kyle@mcmartin.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tulip-users@lists.sourceforge.net \
    --cc=val@nmt.edu \
    /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