Skip to content

Commit

Permalink
mtd: physmap_of: Fix resources leak in 'of_flash_probe()'
Browse files Browse the repository at this point in the history
If 'of_flash_probe_gemini()' or 'of_flash_probe_versatile()' fail, we must
reslease some resources, as already done in all error handling paths in
this function.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
  • Loading branch information
Christophe Jaillet authored and Boris Brezillon committed Aug 15, 2017
1 parent d64dc9c commit 871e7c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mtd/maps/physmap_of_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,10 @@ static int of_flash_probe(struct platform_device *dev)

err = of_flash_probe_gemini(dev, dp, &info->list[i].map);
if (err)
return err;
goto err_out;
err = of_flash_probe_versatile(dev, dp, &info->list[i].map);
if (err)
return err;
goto err_out;

err = -ENOMEM;
info->list[i].map.virt = ioremap(info->list[i].map.phys,
Expand Down

0 comments on commit 871e7c0

Please sign in to comment.