projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2394e62
)
mtd: devices: mchp48l640: Fix memory leak on cmd
author
Colin Ian King
<colin.king@canonical.com>
Mon, 12 Jul 2021 14:52:14 +0000
(15:52 +0100)
committer
Miquel Raynal
<miquel.raynal@bootlin.com>
Fri, 6 Aug 2021 19:44:09 +0000
(21:44 +0200)
The allocation for cmd is not being kfree'd on the return leading to
a memory leak. Fix this by kfree'ing it.
Addresses-Coverity: ("Resource leak")
Fixes:
88d125026753
("mtd: devices: add support for microchip 48l640 EERAM")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link:
https://lore.kernel.org/linux-mtd/20210712145214.101377-1-colin.king@canonical.com
drivers/mtd/devices/mchp48l640.c
patch
|
blob
|
history
diff --git
a/drivers/mtd/devices/mchp48l640.c
b/drivers/mtd/devices/mchp48l640.c
index
ad66b5a
..
99400d0
100644
(file)
--- a/
drivers/mtd/devices/mchp48l640.c
+++ b/
drivers/mtd/devices/mchp48l640.c
@@
-255,6
+255,7
@@
static int mchp48l640_read_page(struct mtd_info *mtd, loff_t from, size_t len,
if (!ret)
*retlen += len;
+ kfree(cmd);
return ret;
fail: