diff options
Diffstat (limited to 'drivers/mtd/devices/blkmtd.c')
-rw-r--r-- | drivers/mtd/devices/blkmtd.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/mtd/devices/blkmtd.c b/drivers/mtd/devices/blkmtd.c index 662e807801ed..59a29e616a22 100644 --- a/drivers/mtd/devices/blkmtd.c +++ b/drivers/mtd/devices/blkmtd.c | |||
@@ -539,11 +539,8 @@ static void free_device(struct blkmtd_dev *dev) | |||
539 | { | 539 | { |
540 | DEBUG(2, "blkmtd: free_device() dev = %p\n", dev); | 540 | DEBUG(2, "blkmtd: free_device() dev = %p\n", dev); |
541 | if(dev) { | 541 | if(dev) { |
542 | if(dev->mtd_info.eraseregions) | 542 | kfree(dev->mtd_info.eraseregions); |
543 | kfree(dev->mtd_info.eraseregions); | 543 | kfree(dev->mtd_info.name); |
544 | if(dev->mtd_info.name) | ||
545 | kfree(dev->mtd_info.name); | ||
546 | |||
547 | if(dev->blkdev) { | 544 | if(dev->blkdev) { |
548 | invalidate_inode_pages(dev->blkdev->bd_inode->i_mapping); | 545 | invalidate_inode_pages(dev->blkdev->bd_inode->i_mapping); |
549 | close_bdev_excl(dev->blkdev); | 546 | close_bdev_excl(dev->blkdev); |