netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Strakh <strakh@ispras.ru>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	Donald Becker <becker@scyld.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] 3c507.c: remove unused NULL pointer check
Date: Mon, 21 Dec 2009 19:23:58 +0000	[thread overview]
Message-ID: <200912211923.58735.strakh@ispras.ru> (raw)

	In driver drivers/net/3c507.c in function Iirqreturn_t el16_interrupt:
1. If in line 555 dev = NULL then we goto line 556
2. In line 556 we have null dereference because pr_err called with dev->name 
in third parameter.
 555        if (dev == NULL) {
 556                pr_err("%s: net_interrupt(): irq %d for unknown device.
\n",
 557                        dev->name, irq);
 558                return IRQ_NONE;
 559        }

Found by Linux Device Drivers Verification (Svace detector)

Remove unused NULL pointer check.

Signed-off-by: Alexander Strakh <strakh@ispras.ru>

---
diff --git a/./0000/drivers/net/3c507.c b/./moder/drivers/net/3c507.c
index fbc2311..3bfb3dd 100644
--- a/./0000/drivers/net/3c507.c
+++ b/./moder/drivers/net/3c507.c
@@ -552,12 +552,6 @@ static irqreturn_t el16_interrupt(int irq, void *dev_id)
 	ushort ack_cmd = 0;
 	void __iomem *shmem;
 
-	if (dev == NULL) {
-		pr_err("%s: net_interrupt(): irq %d for unknown device.\n",
-			dev->name, irq);
-		return IRQ_NONE;
-	}
-
 	ioaddr = dev->base_addr;
 	lp = netdev_priv(dev);
 	shmem = lp->base;

             reply	other threads:[~2009-12-21 19:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-21 19:23 Alexander Strakh [this message]
2009-12-21 16:56 ` [PATCH] 3c507.c: remove unused NULL pointer check Oliver Hartkopp
2009-12-21 20:31   ` Stephen Hemminger
2009-12-21 20:46     ` Oliver Hartkopp

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=200912211923.58735.strakh@ispras.ru \
    --to=strakh@ispras.ru \
    --cc=becker@scyld.com \
    --cc=bzolnier@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).