Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp255711ybi; Wed, 29 May 2019 20:46:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdlqHSR4I4A4YO5oQOCK0caSw+M0P4nidL3iaP0UpTnWKk7hPZ+MCwZNmQMj+6lGN9Pe9h X-Received: by 2002:aa7:8a87:: with SMTP id a7mr1566051pfc.53.1559187960034; Wed, 29 May 2019 20:46:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559187960; cv=none; d=google.com; s=arc-20160816; b=S4pAeLjGoyHpSF3zKjljv/y4ZQ2hCg4zGmK8OIVJcBvpHP1fvcNK3E10ZnIUcsPzNO RT+3xXtUBWdqq+bevH/xkcSySJkAlXytJ2WL2yQAuIHUNZWRVWgCltprmQdYeSg4C0gS yKgA2zmTs2Y+M5FI7bZtesPkcn8vA7LdEAqKGyK7BWKgYZg1VRNS9t9HdnP0L7rVNlgO eBb0GfmeMFqA6Ic8nVpDvUrnjawYKFfHJ5D7WWVVcx8sY0aa/N1kqvomK/KTCQrh7TaT 3Qn6i8jW34LYzTpp5tW9/ycVFuORYfsQzsAAZ10UF9wvh/RyUYiGJZDXO0oyzwPU1jSa hhug== 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=BB1XxQs6UpLMT9gdbrAW2Qz9NM5ldU7843cGGgi8eQY=; b=Qb+AFhNCUpHWP/diC8vxas5EnDrQSQ5qqev7H1AKZKuI9MNiWCj2mLq5YqJfNkOjY1 om7Blc7w99q+K3cPPlQvjU54aTR7xiqMEtiwLcXRiACLHqOLcgeMp/CqPiKccitXWn5X fTry/LUQBUn7aDz16Nv7e9s9sEjesyyNsYFNhBxJ8oqlEC5tH9lr2g8iscxg9WdxBgWC lmATpvCgaEnsS6UKmYF2dfvKeksFWA/g+9xrUozIJ9m7kLbVbvmeVlpk8zujPieYCg7e ZItFhMm5fannM/Xt5i0NAS7WV87npLnkk6w+DMtckryifbH4Xk83VIAuCL4QJfeaFHI3 mCbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="F9oTs/8J"; 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 s128si2165238pfs.242.2019.05.29.20.45.43; Wed, 29 May 2019 20:46:00 -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="F9oTs/8J"; 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 S1732759AbfE3DnW (ORCPT + 99 others); Wed, 29 May 2019 23:43:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:33492 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727489AbfE3DVM (ORCPT ); Wed, 29 May 2019 23:21:12 -0400 Received: from localhost (ip67-88-213-2.z213-88-67.customer.algx.net [67.88.213.2]) (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 BEB0E249D4; Thu, 30 May 2019 03:21:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559186471; bh=XGmnVclwZXZkmuOEHu1RgQWExfuWhKj/ZVh8jChX7aw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F9oTs/8JJ2T4AjweCIEEZ1CDADZWgZ9t0WoImMysg5p70AJOxo/u65ywyrpuN8xp3 y51zDVO1JKhzvv5XPW7npwBhQN7yGwsg/jcfguD9wwahfNjQGodl3+H6NmrJ7eokgG y6vdU1NArdEgQCdEwxcq0YNCJ1Z7/I7LUtnaUm3M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wen Yang , Florian Fainelli , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, Sasha Levin Subject: [PATCH 4.9 101/128] arm64: cpu_ops: fix a leaked reference by adding missing of_node_put Date: Wed, 29 May 2019 20:07:13 -0700 Message-Id: <20190530030452.805037561@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030432.977908967@linuxfoundation.org> References: <20190530030432.977908967@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 [ Upstream commit 92606ec9285fb84cd9b5943df23f07d741384bfc ] 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/arm64/kernel/cpu_ops.c:102:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 69, but without a corresponding object release within this function. Signed-off-by: Wen Yang Reviewed-by: Florian Fainelli Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- arch/arm64/kernel/cpu_ops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/kernel/cpu_ops.c b/arch/arm64/kernel/cpu_ops.c index e137ceaf5016b..82b465207ed0a 100644 --- a/arch/arm64/kernel/cpu_ops.c +++ b/arch/arm64/kernel/cpu_ops.c @@ -85,6 +85,7 @@ static const char *__init cpu_read_enable_method(int cpu) pr_err("%s: missing enable-method property\n", dn->full_name); } + of_node_put(dn); } else { enable_method = acpi_get_enable_method(cpu); if (!enable_method) { -- 2.20.1