diff options
Diffstat (limited to 'drivers/mtd/sm_ftl.c')
| -rw-r--r-- | drivers/mtd/sm_ftl.c | 6 | 
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mtd/sm_ftl.c b/drivers/mtd/sm_ftl.c index 79636349df96..f3bd86e13603 100644 --- a/drivers/mtd/sm_ftl.c +++ b/drivers/mtd/sm_ftl.c @@ -82,7 +82,7 @@ static struct attribute_group *sm_create_sysfs_attributes(struct sm_ftl *ftl)  	/* Create array of pointers to the attributes */ -	attributes = kzalloc(sizeof(struct attribute *) * (NUM_ATTRIBUTES + 1), +	attributes = kcalloc(NUM_ATTRIBUTES + 1, sizeof(struct attribute *),  								GFP_KERNEL);  	if (!attributes)  		goto error3; @@ -750,7 +750,7 @@ static int sm_init_zone(struct sm_ftl *ftl, int zone_num)  	dbg("initializing zone %d", zone_num);  	/* Allocate memory for FTL table */ -	zone->lba_to_phys_table = kmalloc(ftl->max_lba * 2, GFP_KERNEL); +	zone->lba_to_phys_table = kmalloc_array(ftl->max_lba, 2, GFP_KERNEL);  	if (!zone->lba_to_phys_table)  		return -ENOMEM; @@ -1137,7 +1137,7 @@ static void sm_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)  		goto error2;  	/* Allocate zone array, it will be initialized on demand */ -	ftl->zones = kzalloc(sizeof(struct ftl_zone) * ftl->zone_count, +	ftl->zones = kcalloc(ftl->zone_count, sizeof(struct ftl_zone),  								GFP_KERNEL);  	if (!ftl->zones)  		goto error3;  | 
