From patchwork Tue Aug 27 04:41:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 2849990 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 64C2E9F2F4 for ; Tue, 27 Aug 2013 04:46:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9AC5E20326 for ; Tue, 27 Aug 2013 04:46:30 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9AD0B20317 for ; Tue, 27 Aug 2013 04:46:29 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VEBAV-000200-0L; Tue, 27 Aug 2013 04:46:15 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VEBAN-0008PH-LI; Tue, 27 Aug 2013 04:46:07 +0000 Received: from na3sys009aog102.obsmtp.com ([74.125.149.69]) by merlin.infradead.org with smtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VEBA8-0008Nb-5J for linux-arm-kernel@lists.infradead.org; Tue, 27 Aug 2013 04:45:52 +0000 Received: from SC-OWA.marvell.com ([199.233.58.135]) (using TLSv1) by na3sys009aob102.postini.com ([74.125.148.12]) with SMTP ID DSNKUhwu2hJ04grKpFuYxXLY5+F03VI7q53l@postini.com; Mon, 26 Aug 2013 21:45:52 PDT Received: from maili.marvell.com (10.93.76.43) by SC-OWA.marvell.com (10.93.76.28) with Microsoft SMTP Server id 8.3.213.0; Mon, 26 Aug 2013 21:42:56 -0700 Received: from xhacker.marvell.com (unknown [10.37.135.179]) by maili.marvell.com (Postfix) with ESMTP id 55FF11CCD9C; Mon, 26 Aug 2013 21:42:54 -0700 (PDT) From: Jisheng Zhang To: , , , , , , , , Subject: [PATCH v5 2/3] bus: mvebu: add missing of_node_put() to fix reference leak Date: Tue, 27 Aug 2013 12:41:15 +0800 Message-ID: <1377578476-3268-3-git-send-email-jszhang@marvell.com> X-Mailer: git-send-email 1.8.4.rc3 In-Reply-To: <1377578476-3268-1-git-send-email-jszhang@marvell.com> References: <1377578476-3268-1-git-send-email-jszhang@marvell.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130827_004552_337061_86B1CFF1 X-CRM114-Status: UNSURE ( 9.35 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -4.2 (----) Cc: linux@arm.linux.org.uk, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add of_node_put to properly decrement the refcount when we are done using a given node. Signed-off-by: Jisheng Zhang Reviewed-by: Ezequiel Garcia --- drivers/bus/mvebu-mbus.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c index 33c6947..20da90f 100644 --- a/drivers/bus/mvebu-mbus.c +++ b/drivers/bus/mvebu-mbus.c @@ -837,6 +837,7 @@ int __init mvebu_mbus_init(const char *soc, phys_addr_t mbuswins_phys_base, { struct mvebu_mbus_state *mbus = &mbus_state; const struct of_device_id *of_id; + struct device_node *np; int win; for (of_id = of_mvebu_mbus_ids; of_id->compatible; of_id++) @@ -860,8 +861,11 @@ int __init mvebu_mbus_init(const char *soc, phys_addr_t mbuswins_phys_base, return -ENOMEM; } - if (of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric")) + np = of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric"); + if (np) { mbus->hw_io_coherency = 1; + of_node_put(np); + } for (win = 0; win < mbus->soc->num_wins; win++) mvebu_mbus_disable_window(mbus, win);