projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c0b66dc
)
mtd: lpddr: Fix a double free in probe()
author
Dan Carpenter
<dan.carpenter@oracle.com>
Fri, 28 Feb 2020 09:25:54 +0000
(12:25 +0300)
committer
Miquel Raynal
<miquel.raynal@bootlin.com>
Wed, 11 Mar 2020 13:49:30 +0000
(14:49 +0100)
This function is only called from lpddr_probe(). We free "lpddr" both
here and in the caller, so it's a double free. The best place to free
"lpddr" is in lpddr_probe() so let's delete this one.
Fixes:
8dc004395d5e
("[MTD] LPDDR qinfo probing.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link:
https://lore.kernel.org/linux-mtd/20200228092554.o57igp3nqhyvf66t@kili.mountain
drivers/mtd/lpddr/lpddr_cmds.c
patch
|
blob
|
history
diff --git
a/drivers/mtd/lpddr/lpddr_cmds.c
b/drivers/mtd/lpddr/lpddr_cmds.c
index
1efc643
..
9341a8a
100644
(file)
--- a/
drivers/mtd/lpddr/lpddr_cmds.c
+++ b/
drivers/mtd/lpddr/lpddr_cmds.c
@@
-68,7
+68,6
@@
struct mtd_info *lpddr_cmdset(struct map_info *map)
shared = kmalloc_array(lpddr->numchips, sizeof(struct flchip_shared),
GFP_KERNEL);
if (!shared) {
- kfree(lpddr);
kfree(mtd);
return NULL;
}