* [PATCH] mtd: afs: remove unneeded NULL check
@ 2019-05-29 7:18 Ding Xiang
2019-07-07 18:46 ` Richard Weinberger
0 siblings, 1 reply; 2+ messages in thread
From: Ding Xiang @ 2019-05-29 7:18 UTC (permalink / raw)
To: dwmw2, computersforpeace, marek.vasut, miquel.raynal, richard, vigneshr
Cc: linux-mtd, linux-kernel
NULL check before kfree is unneeded, so remove it.
Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com>
---
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
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mtd: afs: remove unneeded NULL check
2019-05-29 7:18 [PATCH] mtd: afs: remove unneeded NULL check Ding Xiang
@ 2019-07-07 18:46 ` Richard Weinberger
0 siblings, 0 replies; 2+ messages in thread
From: Richard Weinberger @ 2019-07-07 18:46 UTC (permalink / raw)
To: Ding Xiang
Cc: Vignesh Raghavendra, Richard Weinberger, LKML, Marek Vasut,
linux-mtd, Miquel Raynal, Brian Norris, David Woodhouse
On Wed, May 29, 2019 at 9:19 AM Ding Xiang
<dingxiang@cmss.chinamobile.com> wrote:
>
> NULL check before kfree is unneeded, so remove it.
>
> Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com>
Applied.
--
Thanks,
//richard
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-07 18:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-29 7:18 [PATCH] mtd: afs: remove unneeded NULL check Ding Xiang
2019-07-07 18:46 ` Richard Weinberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).