mtd: cfi: remove unneeded NULL checks
authorJiri Slaby <jslaby@suse.cz>
Sun, 10 Jan 2010 09:01:19 +0000 (10:01 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Thu, 25 Feb 2010 11:27:38 +0000 (11:27 +0000)
In cfi_intelext_setup and cfi_amdstd_setup, mtd is never NULL.
Remove unnecessary checks.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/chips/cfi_cmdset_0001.c
drivers/mtd/chips/cfi_cmdset_0002.c

index 5fbf29e1e64fcfc9aa7a55ece397670bb79d683a..92530433c11c8513a796dffde600006ff9404358 100644 (file)
@@ -615,10 +615,8 @@ static struct mtd_info *cfi_intelext_setup(struct mtd_info *mtd)
        return mtd;
 
  setup_err:
-       if(mtd) {
-               kfree(mtd->eraseregions);
-               kfree(mtd);
-       }
+       kfree(mtd->eraseregions);
+       kfree(mtd);
        kfree(cfi->cmdset_priv);
        return NULL;
 }
index f3600e8d5382ba9536161340e8196e6b23c0f305..1ebdcdd72d84981b99a9a1b289c2b8e68ee14993 100644 (file)
@@ -494,10 +494,8 @@ static struct mtd_info *cfi_amdstd_setup(struct mtd_info *mtd)
        return mtd;
 
  setup_err:
-       if(mtd) {
-               kfree(mtd->eraseregions);
-               kfree(mtd);
-       }
+       kfree(mtd->eraseregions);
+       kfree(mtd);
        kfree(cfi->cmdset_priv);
        kfree(cfi->cfiq);
        return NULL;