public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] soc: versatile: Add missing kfree in error path
@ 2016-01-11  6:16 Christophe JAILLET
  2016-01-11  6:16 ` [PATCH 2/2] soc: versatile: Drop a useless static qualifier Christophe JAILLET
  0 siblings, 1 reply; 4+ messages in thread
From: Christophe JAILLET @ 2016-01-11  6:16 UTC (permalink / raw)
  To: linus.walleij; +Cc: linux-kernel, kernel-janitors, Christophe JAILLET

If 'of_property_read_string' fails, then 'soc_dev_attr' should be freed,
otherwise, there is a memory leak.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
This patch has already been
   Acked-by: Linus Walleij <linus.walleij@linaro.org>
on 17/07/2015
---
 drivers/soc/versatile/soc-realview.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/versatile/soc-realview.c b/drivers/soc/versatile/soc-realview.c
index c337764..39ffe18 100644
--- a/drivers/soc/versatile/soc-realview.c
+++ b/drivers/soc/versatile/soc-realview.c
@@ -113,8 +113,10 @@ static int realview_soc_probe(struct platform_device *pdev)
 
 	ret = of_property_read_string(np, "compatible",
 				      &soc_dev_attr->soc_id);
-	if (ret)
+	if (ret) {
+		kfree(soc_dev_attr);
 		return -EINVAL;
+	}
 
 	soc_dev_attr->machine = "RealView";
 	soc_dev_attr->family = "Versatile";
-- 
2.5.0


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

end of thread, other threads:[~2016-01-14  9:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-11  6:16 [PATCH 1/2] soc: versatile: Add missing kfree in error path Christophe JAILLET
2016-01-11  6:16 ` [PATCH 2/2] soc: versatile: Drop a useless static qualifier Christophe JAILLET
2016-01-12 11:46   ` Dan Carpenter
2016-01-14  9:12   ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox