From patchwork Mon Aug 26 09:56:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 2849502 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 67D599F271 for ; Mon, 26 Aug 2013 10:03:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 540642020A for ; Mon, 26 Aug 2013 10:03:06 +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 12E0A20134 for ; Mon, 26 Aug 2013 10:03:05 +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 1VDtdV-0004Aa-GE; Mon, 26 Aug 2013 10:03:01 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VDtdR-0002Kc-PP; Mon, 26 Aug 2013 10:02:57 +0000 Received: from na3sys009aog135.obsmtp.com ([74.125.149.84]) by merlin.infradead.org with smtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VDtdO-0002HX-98 for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2013 10:02:55 +0000 Received: from SC-OWA.marvell.com ([199.233.58.135]) (using TLSv1) by na3sys009aob135.postini.com ([74.125.148.12]) with SMTP ID DSNKUhsnmVkLeEeL+O2Tmwl6ZTy7SoKn9C5j@postini.com; Mon, 26 Aug 2013 03:02:54 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 02:58:09 -0700 Received: from xhacker.marvell.com (unknown [10.37.135.179]) by maili.marvell.com (Postfix) with ESMTP id 9B4ED1CCDAE; Mon, 26 Aug 2013 02:58:06 -0700 (PDT) From: Jisheng Zhang To: , , , , , , , , Subject: [PATCH v3 2/3] bus: mvebu: add missing of_node_put() to fix reference leak Date: Mon, 26 Aug 2013 17:56:20 +0800 Message-ID: <1377510981-1793-3-git-send-email-jszhang@marvell.com> X-Mailer: git-send-email 1.8.4.rc3 In-Reply-To: <1377510981-1793-1-git-send-email-jszhang@marvell.com> References: <1377510981-1793-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-20130826_060254_460228_22E1D30C X-CRM114-Status: UNSURE ( 9.30 ) 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.6 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);