Merge tag 'omap-for-v4.18/fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / drivers / mtd / inftlmount.c
index 2d59841..10d977e 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 "