public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 2.6.4: Fix NULL pointer dereference in blkmtd.c
@ 2004-03-11  8:30 Michel Marti
  0 siblings, 0 replies; only message in thread
From: Michel Marti @ 2004-03-11  8:30 UTC (permalink / raw)
  To: linux-kernel

Hello all,

The blkmtd driver oopses in add_device(). The following trivial patch fixes
this.

Cheers,

- Michel


diff -urN linux-2.6.4/drivers/mtd/devices/blkmtd.c linux-2.6.4-mma/drivers/mtd/devices/blkmtd.c
--- linux-2.6.4/drivers/mtd/devices/blkmtd.c	2004-02-18 04:57:13.000000000 +0100
+++ linux-2.6.4-mma/drivers/mtd/devices/blkmtd.c	2004-03-11 09:02:45.000000000 +0100
@@ -664,12 +664,12 @@
  	}

  	memset(dev, 0, sizeof(struct blkmtd_dev));
+	dev->blkdev = bdev;
  	atomic_set(&(dev->blkdev->bd_inode->i_mapping->truncate_count), 0);
  	if(!readonly) {
  		init_MUTEX(&dev->wrbuf_mutex);
  	}

-	dev->blkdev = bdev;
  	dev->mtd_info.size = dev->blkdev->bd_inode->i_size & PAGE_MASK;

  	/* Setup the MTD structure */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-03-11  8:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-11  8:30 [PATCH] 2.6.4: Fix NULL pointer dereference in blkmtd.c Michel Marti

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