Merge tag 'drm-misc-fixes-2021-07-22' of git://anongit.freedesktop.org/drm/drm-misc...
[linux-2.6-microblaze.git] / drivers / mtd / inftlmount.c
index af16d34..6276daa 100644 (file)
@@ -259,20 +259,13 @@ static int find_boot_record(struct INFTLrecord *inftl)
                /* Memory alloc */
                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",
-                               inftl->nb_blocks * sizeof(u16));
+               if (!inftl->PUtable)
                        return -ENOMEM;
-               }
 
                inftl->VUtable = kmalloc_array(inftl->nb_blocks, sizeof(u16),
                                               GFP_KERNEL);
                if (!inftl->VUtable) {
                        kfree(inftl->PUtable);
-                       printk(KERN_WARNING "INFTL: allocation of VUtable "
-                               "failed (%zd bytes)\n",
-                               inftl->nb_blocks * sizeof(u16));
                        return -ENOMEM;
                }
 
@@ -330,7 +323,7 @@ static int check_free_sectors(struct INFTLrecord *inftl, unsigned int address,
 
        buf = kmalloc(SECTORSIZE + mtd->oobsize, GFP_KERNEL);
        if (!buf)
-               return -1;
+               return -ENOMEM;
 
        ret = -1;
        for (i = 0; i < len; i += SECTORSIZE) {
@@ -558,12 +551,8 @@ int INFTL_mount(struct INFTLrecord *s)
 
        /* Temporary buffer to store ANAC numbers. */
        ANACtable = kcalloc(s->nb_blocks, sizeof(u8), GFP_KERNEL);
-       if (!ANACtable) {
-               printk(KERN_WARNING "INFTL: allocation of ANACtable "
-                               "failed (%zd bytes)\n",
-                               s->nb_blocks * sizeof(u8));
+       if (!ANACtable)
                return -ENOMEM;
-       }
 
        /*
         * First pass is to explore each physical unit, and construct the