From: Jinqiu <crindy646@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: [patch] Fix bug #13853: dereference pointer 'dev' before null check
Date: Wed, 02 Mar 2011 21:20:21 -0500 [thread overview]
Message-ID: <4D6EFAE5.4000400@gmail.com> (raw)
This patch fixes bug #13853 .This still exists in latest version.
'dev' is dereferenced before testing for NULL.
Signed-off-by: Jinqiu Yang<crindy646@gmail.com>
--- a/drivers/net/ariadne.c
+++ b/drivers/net/ariadne.c
@@ -420,7 +420,7 @@ static inline void ariadne_reset(struct
static irqreturn_t ariadne_interrupt(int irq, void *data)
{
struct net_device *dev = (struct net_device *) data;
- volatile struct Am79C960 *lance = (struct Am79C960*)dev->base_addr;
+ volatile struct Am79C960 *lance;
struct ariadne_private *priv;
int csr0, boguscnt;
int handled = 0;
@@ -429,6 +429, 7 @@ static irqreturn_t ariadne_interrupt(int
printk(KERN_WARNING "ariadne_interrupt(): irq for unknown device.\n");
return IRQ_NONE;
}
+ lance = (struct Am79C960 *)dev->base_addr;
lance->RAP = CSR0; /* PCnet-ISA Controller Status */
next reply other threads:[~2011-03-03 2:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-03 2:20 Jinqiu [this message]
2011-03-03 2:50 ` [patch] Fix bug #13853: dereference pointer 'dev' before null check Li Zefan
2011-03-03 8:11 ` Wolfram Sang
2011-03-03 16:41 ` Randy Dunlap
2011-03-04 2:03 ` Li Zefan
2011-03-03 16:42 ` Randy Dunlap
2011-03-03 19:23 ` Randy Dunlap
2011-03-03 19:29 ` Randy Dunlap
2011-03-03 21:19 ` Jinqiu
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=4D6EFAE5.4000400@gmail.com \
--to=crindy646@gmail.com \
--cc=linux-kernel@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