From fa671646f61182cd18234461a6e65f50c6558695 Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Mon, 7 Nov 2005 01:01:27 -0800 Subject: [PATCH] kfree cleanup: drivers/mtd This is the drivers/mtd part of the big kfree cleanup patch. Remove pointless checks for NULL prior to calling kfree() in drivers/mtd/. Signed-off-by: Jesper Juhl Cc: David Woodhouse Acked-by: Joern Engel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/mtd/chips/cfi_cmdset_0002.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/mtd/chips/cfi_cmdset_0002.c') diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index 8505f118f2d..0e6475050da 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c @@ -378,8 +378,7 @@ static struct mtd_info *cfi_amdstd_setup(struct mtd_info *mtd) setup_err: if(mtd) { - if(mtd->eraseregions) - kfree(mtd->eraseregions); + kfree(mtd->eraseregions); kfree(mtd); } kfree(cfi->cmdset_priv); @@ -1742,6 +1741,7 @@ static void cfi_amdstd_destroy(struct mtd_info *mtd) { struct map_info *map = mtd->priv; struct cfi_private *cfi = map->fldrv_priv; + kfree(cfi->cmdset_priv); kfree(cfi->cfiq); kfree(cfi); -- cgit v1.2.3