Skip to content

Commit

Permalink
mtd: lpddr: Fix a double free in probe()
Browse files Browse the repository at this point in the history
commit 4da0ea7 upstream.

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: 8dc0043 ("[MTD] LPDDR qinfo probing.")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Miquel Raynal <[email protected]>
Link: https://lore.kernel.org/linux-mtd/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Dan Carpenter authored and gregkh committed Apr 23, 2020
1 parent 93814a2 commit f752144
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion drivers/mtd/lpddr/lpddr_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit f752144

Please sign in to comment.