public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] Fix bug #13853: dereference pointer 'dev' before null check
@ 2011-03-03  2:20 Jinqiu
  2011-03-03  2:50 ` Li Zefan
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Jinqiu @ 2011-03-03  2:20 UTC (permalink / raw)
  To: linux-kernel

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 */





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-03-04  2:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-03  2:20 [patch] Fix bug #13853: dereference pointer 'dev' before null check Jinqiu
2011-03-03  2:50 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox