linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: physmap_of: Fix resources leak in 'of_flash_probe()'
@ 2017-08-06 12:55 Christophe JAILLET
  2017-08-17 13:03 ` Boris Brezillon
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2017-08-06 12:55 UTC (permalink / raw)
  To: dwmw2, computersforpeace, boris.brezillon, marek.vasut, richard,
	cyrille.pitchen
  Cc: linux-mtd, linux-kernel, kernel-janitors, Christophe JAILLET

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>
---
 drivers/mtd/maps/physmap_of_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/maps/physmap_of_core.c b/drivers/mtd/maps/physmap_of_core.c
index 62fa6836f218..2c8cc97ce019 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,
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mtd: physmap_of: Fix resources leak in 'of_flash_probe()'
  2017-08-06 12:55 [PATCH] mtd: physmap_of: Fix resources leak in 'of_flash_probe()' Christophe JAILLET
@ 2017-08-17 13:03 ` Boris Brezillon
  0 siblings, 0 replies; 2+ messages in thread
From: Boris Brezillon @ 2017-08-17 13:03 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: dwmw2, computersforpeace, marek.vasut, richard, cyrille.pitchen,
	linux-mtd, linux-kernel, kernel-janitors

Le Sun,  6 Aug 2017 14:55:01 +0200,
Christophe JAILLET <christophe.jaillet@wanadoo.fr> a écrit :

> 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.

Applied to l2-mtd/master.

Thanks,

Boris

> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/mtd/maps/physmap_of_core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/maps/physmap_of_core.c b/drivers/mtd/maps/physmap_of_core.c
> index 62fa6836f218..2c8cc97ce019 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,

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-17 13:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-06 12:55 [PATCH] mtd: physmap_of: Fix resources leak in 'of_flash_probe()' Christophe JAILLET
2017-08-17 13:03 ` Boris Brezillon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).