Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2988496yba; Mon, 22 Apr 2019 17:16:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqx2zUqcyy5yQZC5VgmdHyTfJDrYiJOY+FxbJ7LVFf7zFWpV8YoA98Uu7yP8/UEnU6pXo4nb X-Received: by 2002:a62:1d0d:: with SMTP id d13mr23604476pfd.96.1555978562085; Mon, 22 Apr 2019 17:16:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555978562; cv=none; d=google.com; s=arc-20160816; b=BPzJjbY8TYCyNlxMkxU2tXqvJJq0Uv4fposkxCTljkPq7AKRts2sPhLO5b99mIe/Nq fUrmMngRjnVCQehrtpqmytF07SK6uBptAJ3CIq2wi4NRA/aacoLIwIVIq2UEjRkuXEcl sAc0s3gppLzj6dDDbhUmIbCbapO1jq94yKOGULhM/yY4vwLziOvgq3PJnOcTeFtrqhv9 a6cwwmYcikefZFVIpTL2rHXqXGBJrJvZR19Yfke5qBBlTlCxM1xmJzcEUQLQGl3yXLzr 4yQSOTujUPpcuIh5bZ8dq3z1tJ2HKWvr79H4MIEBEbsHromALjJpkD9iH33lrUEQIqXI AbAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QWeSoxmEF0/75BciIlrDOjAJ+D0SeqCLsvy9fDJvIvs=; b=CzPrB2tScXoZcS56/PGT/pbQ0FeifGIlyEnnSEh2QBBtOasmYDLEi7cZlRzJ0ATTSO ODD9sE1BTd+snekJMgNgD39wblJKCsAjrIeed/9n0vpJDesOGQFd+tGavd/+EenR4hzv ihKWOrLYw6Zw3cHrR3K3Mg3grk/rxHHRF/DVTCRzhA/8T/f48PKjWsfEKnUAHWSMfqpT oQAvYeGacjie/3iOcdEvcA0sTEAB2bqEORPNnlViIkuw43XhjJZxrZCUImcp6awCG+MF KtykIQdeGO+j11A3+/FVQjcR0f0VraXzJzfFT0AV+jB0Yqvokn9htD502/tDNH7d9qqJ n0AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NzOHkq9y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7si14674117pfc.152.2019.04.22.17.15.46; Mon, 22 Apr 2019 17:16:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NzOHkq9y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732160AbfDVUEA (ORCPT + 99 others); Mon, 22 Apr 2019 16:04:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:47670 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729307AbfDVTpr (ORCPT ); Mon, 22 Apr 2019 15:45:47 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B11E7218EA; Mon, 22 Apr 2019 19:45:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555962346; bh=zM9sG0IzfsYUlFjFZF9jYc/HS/oFBdSZvNIYTLAxtEA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NzOHkq9yezILcU0A3yTTx11WuleOgG77flHp+xYRDulXJj6RJy2m4k0L1rHJyor7v QjC4bdF7Ik5syz9eCJdg71Q0BjyG2fc/8D8icz40qlMmsmu6pz/E/OIqvXhEnXunvh Adowh8C05yf2z7O0NCDcssheCnx8/Ppifk8jAJWU= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Wen Yang , Russell King , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Lucas Stach , linux-arm-kernel@lists.infradead.org, Sasha Levin Subject: [PATCH AUTOSEL 4.19 15/68] ARM: imx51: fix a leaked reference by adding missing of_node_put Date: Mon, 22 Apr 2019 15:44:23 -0400 Message-Id: <20190422194516.11634-15-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190422194516.11634-1-sashal@kernel.org> References: <20190422194516.11634-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wen Yang [ Upstream commit 0c17e83fe423467e3ccf0a02f99bd050a73bbeb4 ] The call to of_get_next_child returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./arch/arm/mach-imx/mach-imx51.c:64:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 57, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Russell King Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: Lucas Stach Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Shawn Guo Signed-off-by: Sasha Levin (Microsoft) --- arch/arm/mach-imx/mach-imx51.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-imx/mach-imx51.c b/arch/arm/mach-imx/mach-imx51.c index c7169c2f94c4..08c7892866c2 100644 --- a/arch/arm/mach-imx/mach-imx51.c +++ b/arch/arm/mach-imx/mach-imx51.c @@ -59,6 +59,7 @@ static void __init imx51_m4if_setup(void) return; m4if_base = of_iomap(np, 0); + of_node_put(np); if (!m4if_base) { pr_err("Unable to map M4IF registers\n"); return; -- 2.19.1