summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps
diff options
context:
space:
mode:
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>2017-08-06 14:55:01 +0200
committerBoris Brezillon <boris.brezillon@free-electrons.com>2017-08-15 14:00:47 +0200
commit871e7c01ca55fdc714691206f041e48f695f444c (patch)
tree4c432aa6a036d3f2b3c196b358e3a6d303eba309 /drivers/mtd/maps
parentmtd: pci: constify pci_device_id. (diff)
downloadlinux-871e7c01ca55fdc714691206f041e48f695f444c.tar.xz
linux-871e7c01ca55fdc714691206f041e48f695f444c.zip
mtd: physmap_of: Fix resources leak in 'of_flash_probe()'
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>
Diffstat (limited to 'drivers/mtd/maps')
-rw-r--r--drivers/mtd/maps/physmap_of_core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/maps/physmap_of_core.c b/drivers/mtd/maps/physmap_of_core.c
index 1343c34092ca..b1bd4faecfb2 100644
--- a/drivers/mtd/maps/physmap_of_core.c
+++ b/drivers/mtd/maps/physmap_of_core.c
@@ -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,