[PATCH] mtd: afs: remove unneeded NULL check
From: Ding Xiang
Date: Wed May 29 2019 - 03:31:47 EST
NULL check before kfree is unneeded, so remove it.
Signed-off-by: Ding Xiang <dingxiang@xxxxxxxxxxxxxxxxxxxx>
---
drivers/mtd/parsers/afs.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/mtd/parsers/afs.c b/drivers/mtd/parsers/afs.c
index 0c73002..972b260 100644
--- a/drivers/mtd/parsers/afs.c
+++ b/drivers/mtd/parsers/afs.c
@@ -383,8 +383,7 @@ static int parse_afs_partitions(struct mtd_info *mtd,
out_free_parts:
while (i >= 0) {
- if (parts[i].name)
- kfree(parts[i].name);
+ kfree(parts[i].name);
i--;
}
kfree(parts);
--
1.9.1