diff options
Diffstat (limited to 'drivers/mtd/devices/block2mtd.c')
-rw-r--r-- | drivers/mtd/devices/block2mtd.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c index 401c6a294baa..6d917a4daa9d 100644 --- a/drivers/mtd/devices/block2mtd.c +++ b/drivers/mtd/devices/block2mtd.c | |||
@@ -295,10 +295,9 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size) | |||
295 | if (!devname) | 295 | if (!devname) |
296 | return NULL; | 296 | return NULL; |
297 | 297 | ||
298 | dev = kmalloc(sizeof(struct block2mtd_dev), GFP_KERNEL); | 298 | dev = kzalloc(sizeof(struct block2mtd_dev), GFP_KERNEL); |
299 | if (!dev) | 299 | if (!dev) |
300 | return NULL; | 300 | return NULL; |
301 | memset(dev, 0, sizeof(*dev)); | ||
302 | 301 | ||
303 | /* Get a handle on the device */ | 302 | /* Get a handle on the device */ |
304 | bdev = open_bdev_excl(devname, O_RDWR, NULL); | 303 | bdev = open_bdev_excl(devname, O_RDWR, NULL); |