mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
mtd: lpddr: Fix a double free in probe()
commit4da0ea71eaupstream. 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:8dc004395d("[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 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
eb6f402b87
commit
6ada00436c
@@ -81,7 +81,6 @@ struct mtd_info *lpddr_cmdset(struct map_info *map)
|
||||
shared = kmalloc(sizeof(struct flchip_shared) * lpddr->numchips,
|
||||
GFP_KERNEL);
|
||||
if (!shared) {
|
||||
kfree(lpddr);
|
||||
kfree(mtd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user