aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/chips
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2010-01-10 04:01:19 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-02-25 06:27:38 -0500
commit17fabf156507ec0f688f1e58be02f38e04de0c6e (patch)
tree08cb2aa3d7b9420d1b2e8f5c225060b2a8d4e75b /drivers/mtd/chips
parentb2d4fbab79bd2b121c56db757c3a0f06ec7e0868 (diff)
mtd: cfi: remove unneeded NULL checks
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>
Diffstat (limited to 'drivers/mtd/chips')
-rw-r--r--drivers/mtd/chips/cfi_cmdset_0001.c6
-rw-r--r--drivers/mtd/chips/cfi_cmdset_0002.c6
2 files changed, 4 insertions, 8 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
index 5fbf29e1e64f..92530433c11c 100644
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -615,10 +615,8 @@ static struct mtd_info *cfi_intelext_setup(struct mtd_info *mtd)
615 return mtd; 615 return mtd;
616 616
617 setup_err: 617 setup_err:
618 if(mtd) { 618 kfree(mtd->eraseregions);
619 kfree(mtd->eraseregions); 619 kfree(mtd);
620 kfree(mtd);
621 }
622 kfree(cfi->cmdset_priv); 620 kfree(cfi->cmdset_priv);
623 return NULL; 621 return NULL;
624} 622}
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index f3600e8d5382..1ebdcdd72d84 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -494,10 +494,8 @@ static struct mtd_info *cfi_amdstd_setup(struct mtd_info *mtd)
494 return mtd; 494 return mtd;
495 495
496 setup_err: 496 setup_err:
497 if(mtd) { 497 kfree(mtd->eraseregions);
498 kfree(mtd->eraseregions); 498 kfree(mtd);
499 kfree(mtd);
500 }
501 kfree(cfi->cmdset_priv); 499 kfree(cfi->cmdset_priv);
502 kfree(cfi->cfiq); 500 kfree(cfi->cfiq);
503 return NULL; 501 return NULL;