netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Micah Gruber <micah.gruber@gmail.com>
To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, jgarzik@pobox.com
Subject: [CORRECTION][PATCH] Fix a potential NULL pointer dereference in uli526x_interrupt() in drivers/net/tulip/uli526x.c
Date: Tue, 04 Sep 2007 16:14:06 +0800	[thread overview]
Message-ID: <46DD13CE.6010905@gmail.com> (raw)

This patch fixes a potential null dereference bug where we dereference dev before a null check. This patch simply moves the dereferencing after the null check.

Signed-off-by: Micah Gruber <micah.gruber@gmail.com>
---

--- a/drivers/net/tulip/uli526x.c
+++ b/drivers/net/tulip/uli526x.c
@@ -663,7 +663,7 @@
 {
 	struct net_device *dev = dev_id;
 	struct uli526x_board_info *db = netdev_priv(dev);
-	unsigned long ioaddr = dev->base_addr;
+	unsigned long ioaddr;
 	unsigned long flags;
 
 	if (!dev) {
@@ -671,6 +671,8 @@
 		return IRQ_NONE;
 	}
 
+	ioaddr = dev->base_addr;
+
 	spin_lock_irqsave(&db->lock, flags);
 	outl(0, ioaddr + DCR7);


             reply	other threads:[~2007-09-04  8:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-04  8:14 Micah Gruber [this message]
2007-09-07 23:20 ` [CORRECTION][PATCH] Fix a potential NULL pointer dereference in uli526x_interrupt() in drivers/net/tulip/uli526x.c Jeff Garzik
2007-09-13  9:03 ` Andrew Morton
2007-09-13  9:03   ` Kyle McMartin
2007-09-13 14:16   ` 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=46DD13CE.6010905@gmail.com \
    --to=micah.gruber@gmail.com \
    --cc=jgarzik@pobox.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).