treewide: kmalloc() -> kmalloc_array()
[linux-block.git] / drivers / mtd / inftlmount.c
index 2d598412972dcd3f6350fae3d9c9b8481811824b..10d977e9709d5cb01b2150a1480f77c60ea32f96 100644 (file)
@@ -270,7 +270,8 @@ static int find_boot_record(struct INFTLrecord *inftl)
                inftl->nb_blocks = ip->lastUnit + 1;
 
                /* Memory alloc */
-               inftl->PUtable = kmalloc(inftl->nb_blocks * sizeof(u16), GFP_KERNEL);
+               inftl->PUtable = kmalloc_array(inftl->nb_blocks, sizeof(u16),
+                                              GFP_KERNEL);
                if (!inftl->PUtable) {
                        printk(KERN_WARNING "INFTL: allocation of PUtable "
                                "failed (%zd bytes)\n",
@@ -278,7 +279,8 @@ static int find_boot_record(struct INFTLrecord *inftl)
                        return -ENOMEM;
                }
 
-               inftl->VUtable = kmalloc(inftl->nb_blocks * sizeof(u16), GFP_KERNEL);
+               inftl->VUtable = kmalloc_array(inftl->nb_blocks, sizeof(u16),
+                                              GFP_KERNEL);
                if (!inftl->VUtable) {
                        kfree(inftl->PUtable);
                        printk(KERN_WARNING "INFTL: allocation of VUtable "