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>
This commit is contained in:
Родитель
b2d4fbab79
Коммит
17fabf1565
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче