Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp84340yba; Mon, 20 May 2019 05:25:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwyWZ8GqnF/BykW1bD4tntf7ZwsWUtFZ/0PPHzkCX4OXu55mVfwvM4unkq2PZLwwOHk9rQX X-Received: by 2002:a65:5c41:: with SMTP id v1mr230224pgr.20.1558355157565; Mon, 20 May 2019 05:25:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558355157; cv=none; d=google.com; s=arc-20160816; b=s88yq/vGCKGXFci3J62YmQox/WG2byU6DATV4iQwbte+nIqgXlMF+UdG/jbfeZqJcm WLsBDlVrq4i0pCAzGgSMLa3B7qJnmy7yM6C2Y4yWRjDetshiwgOlOjJz59BUFLhshfIS DOKF6eZvrfKIfk8e6xjMm7UZD6FwLGuUEt84zkVpWZBwxceYHe1vZs0KqbVJHBVRlcSB MPV0GIejKsQEtul4Bk233RidSQ7OA6ooIVz5kaX+nZ3q7Pa5QJKAWK06IFMKrxlPSV25 XxltadFEohyLqwtrQq3HkjS7o2SXDEfonrExGJvZv4JyEOIWhNyNRt0Vz0asstPoIVjR gCSw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TtuDmcAB1A3qcTaMphljx/F+XYUsb+qYGHbcdhF3AzY=; b=nztv2u8d1OTRScXaTaSpyDE08Qy7AiIUn9Ru6cuNOI1ewVpD3XqWifqAb2ezodYJR5 ZVR7QAMhS8uVer9lPaFqOWsMqMLftUip50fioDjcUG+75HSU7cYHg8A6pm8MGA2z31uh hrBA9shBeN6DKqio3Cj9iBGeBiyVt0wvyPI5ks745OHNNYeOFuOkcwAjuPux3Ifhrc4R DkMtnCSgqlkRphC0p6L3+cO8wYBxyuNA8d+GkR8DOrLgfj3buzaQgr4dMpE4Bz+cQ9G7 giuqHi0UY2ty8cRMuX1l6DNI9RR8VYDgPRKqsQtSK/6lhTCBBj4I/LCaV2tpjzkkRdxs uPSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HkaxxxM1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z19si18425228pgi.180.2019.05.20.05.25.43; Mon, 20 May 2019 05:25:57 -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=HkaxxxM1; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388257AbfETMWy (ORCPT + 99 others); Mon, 20 May 2019 08:22:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:37010 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388504AbfETMWu (ORCPT ); Mon, 20 May 2019 08:22:50 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6F53220645; Mon, 20 May 2019 12:22:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558354969; bh=s1AmIjUuHttMtGumDw8a0cBTSEY0tPGQ3gjnVenLO6M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HkaxxxM1GmBhAr4XiAh+pGKs7OIx6y71HuD6iuQMjGy+LPpV9xa9iBtcvtA0awXQP XT2QbQdCG6j0fhbUXiQS3zv7n7Qt5mghwIu4219fT3aOQ+EVqkExgN+8vnHw1Jjk3e idcPLRHzbzqfhIZ+v0WwcJCpJRm259i0YujWVmTI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wen Yang , Krzysztof Kozlowski Subject: [PATCH 4.19 009/105] ARM: exynos: Fix a leaked reference by adding missing of_node_put Date: Mon, 20 May 2019 14:13:15 +0200 Message-Id: <20190520115247.693573799@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190520115247.060821231@linuxfoundation.org> References: <20190520115247.060821231@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 commit 629266bf7229cd6a550075f5961f95607b823b59 upstream. 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 warnings like: arch/arm/mach-exynos/firmware.c:201:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 193, but without a corresponding object release within this function. Cc: stable@vger.kernel.org Signed-off-by: Wen Yang Signed-off-by: Krzysztof Kozlowski Signed-off-by: Greg Kroah-Hartman --- arch/arm/mach-exynos/firmware.c | 1 + arch/arm/mach-exynos/suspend.c | 2 ++ 2 files changed, 3 insertions(+) --- a/arch/arm/mach-exynos/firmware.c +++ b/arch/arm/mach-exynos/firmware.c @@ -196,6 +196,7 @@ void __init exynos_firmware_init(void) return; addr = of_get_address(nd, 0, NULL, NULL); + of_node_put(nd); if (!addr) { pr_err("%s: No address specified.\n", __func__); return; --- a/arch/arm/mach-exynos/suspend.c +++ b/arch/arm/mach-exynos/suspend.c @@ -639,8 +639,10 @@ void __init exynos_pm_init(void) if (WARN_ON(!of_find_property(np, "interrupt-controller", NULL))) { pr_warn("Outdated DT detected, suspend/resume will NOT work\n"); + of_node_put(np); return; } + of_node_put(np); pm_data = (const struct exynos_pm_data *) match->data;