From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,T_DKIMWL_WL_HIGH,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB664C072B1 for ; Thu, 30 May 2019 04:23:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A5C5B2538D for ; Thu, 30 May 2019 04:23:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559190214; bh=UJiPpQOR8Dhm936UzxmqRdc9QwzhXyAeIt40ybzJZ4E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=uZaUVm6RntxXc319FhPwvdG1N6jvrd1l9hCZ0DJNZHi1tuQQwPgCCS6GJ0E+FKEkT xbUidKKHH+QXby555b45M41lpjLSz6pM63LH7pPvG/jZSaIh3ejDKCk4Ow5DUAOOLU +khSNMr5Q5ODUfi83yxy66iUKx5WlE397WdbzoY8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728641AbfE3EXd (ORCPT ); Thu, 30 May 2019 00:23:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:36638 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730049AbfE3DPB (ORCPT ); Wed, 29 May 2019 23:15:01 -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 C4CFF2449A; Thu, 30 May 2019 03:15:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559186100; bh=UJiPpQOR8Dhm936UzxmqRdc9QwzhXyAeIt40ybzJZ4E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ytKUHtUY8lL+PNk7Ai9eOrZaDiEGrcRwve6zghWvTU6e9q+eiFYSMLxc7cabePBeI xIwGXNZsksGXp75vf9qFac2XEjQ1hHnLsodS5oeVMRYgVv4Og9YBpZeEvR/65NmM7B WBfShro8bXWPmyxlqgJxzqhWDvDJTBWQV9kQSCpg= 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 5.0 237/346] arm64: cpu_ops: fix a leaked reference by adding missing of_node_put Date: Wed, 29 May 2019 20:05:10 -0700 Message-Id: <20190530030553.042815312@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030540.363386121@linuxfoundation.org> References: <20190530030540.363386121@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 ea001241bdd47..00f8b8612b69f 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("%pOF: missing enable-method property\n", dn); } + of_node_put(dn); } else { enable_method = acpi_get_enable_method(cpu); if (!enable_method) { -- 2.20.1