Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1704854 > unrolled thread

[PATCH] mtd: physmap_of: Fix resources leak in 'of_flash_probe()'

Started byChristophe JAILLET <christophe.jaillet@wanadoo.fr>
First post2017-08-06 16:10 +0200
Last post2017-08-06 16:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] mtd: physmap_of: Fix resources leak in 'of_flash_probe()' Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2017-08-06 16:10 +0200

#1704854 — [PATCH] mtd: physmap_of: Fix resources leak in 'of_flash_probe()'

FromChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Date2017-08-06 16:10 +0200
Subject[PATCH] mtd: physmap_of: Fix resources leak in 'of_flash_probe()'
Message-ID<ubupJ-3f0-37@gated-at.bofh.it>
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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web