From: Adrian Bunk <bunk@stusta.de>
To: jes@trained-monkey.org, Jeff Garzik <jeff@garzik.org>
Cc: linux-acenic@sunsite.dk, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [2.6 patch] drivers/net/acenic.c: fix check-after-use
Date: Mon, 23 Jul 2007 10:02:32 +0200 [thread overview]
Message-ID: <20070723080232.GF26212@stusta.de> (raw)
The Coverity checker noted that we've already dereferenced "dev" when we
check whether it's NULL.
Since it's impossible that "dev" is NULL at this place this patch
removes the NULL check.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
--- linux-2.6.22-rc6-mm1/drivers/net/acenic.c.old 2007-07-23 04:06:05.000000000 +0200
+++ linux-2.6.22-rc6-mm1/drivers/net/acenic.c 2007-07-23 04:08:11.000000000 +0200
@@ -3124,20 +3124,14 @@ static int __devinit read_eeprom_byte(st
struct ace_private *ap = netdev_priv(dev);
struct ace_regs __iomem *regs = ap->regs;
unsigned long flags;
u32 local;
int result = 0;
short i;
- if (!dev) {
- printk(KERN_ERR "No device!\n");
- result = -ENODEV;
- goto out;
- }
-
/*
* Don't take interrupts on this CPU will bit banging
* the %#%#@$ I2C device
*/
local_irq_save(flags);
eeprom_start(regs);
next reply other threads:[~2007-07-23 8:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-23 8:02 Adrian Bunk [this message]
2007-07-24 20:37 ` [2.6 patch] drivers/net/acenic.c: fix check-after-use 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=20070723080232.GF26212@stusta.de \
--to=bunk@stusta.de \
--cc=jeff@garzik.org \
--cc=jes@trained-monkey.org \
--cc=linux-acenic@sunsite.dk \
--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).