Skip to contentSkip to conversation

PATCH: make blkmtd work

PATCH Matthew Reimer 1 participant 1 message Mar 6, 2004 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

blkmtd wasn't working for me at all, oopsing because it tried to dereference a NULL pointer. This patch fixes it:

blkmtd.c 2004-03-06 11:58:45.000000000 -0600 renamed from blkmtd.c.orig 2004-03-06 11:58:30.000000000 -0600 +1 -1
@@ -664,12 +664,12 @@ static struct blkmtd_dev *add_device(cha
       }
 
       memset(dev, 0, sizeof(struct blkmtd_dev));
-       atomic_set(&(dev->blkdev->bd_inode->i_mapping->truncate_count), 0);
       if(!readonly) {
               init_MUTEX(&dev->wrbuf_mutex);
       }
 
       dev->blkdev = bdev;
+       atomic_set(&(dev->blkdev->bd_inode->i_mapping->truncate_count), 0);
       dev->mtd_info.size = dev->blkdev->bd_inode->i_size & PAGE_MASK;
 
       /* Setup the MTD structure */

This patch makes it work for me. Does this look right? If so, how do I go about getting it committed?

Matt