Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752643AbbFAMax (ORCPT ); Mon, 1 Jun 2015 08:30:53 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:52692 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752082AbbFAMa2 (ORCPT ); Mon, 1 Jun 2015 08:30:28 -0400 From: Vladimir Zapolskiy To: Philipp Zabel , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Arnd Bergmann , Greg Kroah-Hartman CC: Subject: [PATCH v5 2/7] misc: sram: fix device node reference leak on error Date: Mon, 1 Jun 2015 15:29:55 +0300 Message-ID: <1433161800-2868-3-git-send-email-vladimir_zapolskiy@mentor.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1433161800-2868-1-git-send-email-vladimir_zapolskiy@mentor.com> References: <1433161800-2868-1-git-send-email-vladimir_zapolskiy@mentor.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [137.202.0.76] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1074 Lines: 36 A pointer device node reference should be decremented on manual exit from for_each_available_child_of_node() loop. Signed-off-by: Vladimir Zapolskiy --- drivers/misc/sram.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c index 76a23f9..0bfdfac 100644 --- a/drivers/misc/sram.c +++ b/drivers/misc/sram.c @@ -112,6 +112,7 @@ static int sram_probe(struct platform_device *pdev) dev_err(&pdev->dev, "could not get address for node %s\n", child->full_name); + of_node_put(child); goto err_chunks; } @@ -120,6 +121,7 @@ static int sram_probe(struct platform_device *pdev) "reserved block %s outside the sram area\n", child->full_name); ret = -EINVAL; + of_node_put(child); goto err_chunks; } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/