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>
This commit is contained in:

committed by
Boris Brezillon

parent
d64dc9c847
commit
871e7c01ca
@@ -235,10 +235,10 @@ static int of_flash_probe(struct platform_device *dev)
|
|||||||
|
|
||||||
err = of_flash_probe_gemini(dev, dp, &info->list[i].map);
|
err = of_flash_probe_gemini(dev, dp, &info->list[i].map);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
goto err_out;
|
||||||
err = of_flash_probe_versatile(dev, dp, &info->list[i].map);
|
err = of_flash_probe_versatile(dev, dp, &info->list[i].map);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
goto err_out;
|
||||||
|
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
info->list[i].map.virt = ioremap(info->list[i].map.phys,
|
info->list[i].map.virt = ioremap(info->list[i].map.phys,
|
||||||
|
Reference in New Issue
Block a user