Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp273018ybi; Wed, 29 May 2019 21:07:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7AsnLQFbC6kJXpzkm0LZ13jUOmtCd/XrnrjPbz/KAsj1VyMjJnqQBhURnSG14k0p0w3Zq X-Received: by 2002:aa7:910e:: with SMTP id 14mr1650166pfh.153.1559189273317; Wed, 29 May 2019 21:07:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559189273; cv=none; d=google.com; s=arc-20160816; b=r4vzBNIDqPaymiCrvQzHnZ1Zy+XEusb9xOB8JBQa0jGMUmhvjBBOx165B7JSA4dyjb C065pR3+ZI2bDBnLZUYXIZTP6AHtyiV/qy3CZmhgp8roo5w6zF7ssoD9zBFvnLWJG6KZ VwATL6MwwfCQRBCoZTpgk75z0coaar05xhVuy+6BFyENE3OmbHJBvYQ22n4sf72KssrP rlrH9pA9DKgUzExt6VmK6jlDTJTkh5RVSogz8R1jNywF0wLWUwFOUgkObG+bMjPiZJFK 5Dl0MT6CD2Vbc0E62Bsy3NPXapNWhjWJllMSCJ+w2hb0mFkj22JoZ6aiEb9JfqRsrwiO FGdA== 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=mYH9E9zs4pWz8Nh9lplyMq2gRBEQCbOTQZu85myoW0c=; b=QhQeOhnGzRT2eOPwMOtAxLQJ+K4yR08kokgZmnlaO6elhONTaLYZZOj29Bzwe5IhfJ Eltqlwpr9Dj+a8Q9Hli5k6p4IAVW/R6/6UrGb1zCzkz/cjJZhe+Uj1Bw/n19Twug9jmr ytsHq8w3o6T3lcq9u+zHrWz15OwJfEl5X6X/khy+JXG5xsHywoJXwc44kK/6FYctxSoT 0HyxTtOpxUm6QlDd0w6O5gUI7eF/1etDYI6oPaDH9ghIz51spv3Nautb1BfS5bRpRs/W HxXR0OoyOXnZv3QDBLZjVyCCT9F4KmN3mL61JgZ8o6Jp07t6x0zkKlKHvxZF4qM1Qm// 5Z4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0LKpMCeG; 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 b19si2343066pfi.23.2019.05.29.21.07.37; Wed, 29 May 2019 21:07:53 -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=0LKpMCeG; 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 S1729102AbfE3EFJ (ORCPT + 99 others); Thu, 30 May 2019 00:05:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:48242 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731252AbfE3DRs (ORCPT ); Wed, 29 May 2019 23:17:48 -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 B1AC824725; Thu, 30 May 2019 03:17:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559186267; bh=UJiPpQOR8Dhm936UzxmqRdc9QwzhXyAeIt40ybzJZ4E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0LKpMCeGDvyyGVWBzoVbciG3u4dWMuxt0J3awRe4XbjaS4rVrVGsEaHj5m5Twyn9l 3Kdzs6BGaCPKbI2HnQNr1kIYLoU4D5/shIca0qnywLQnB0aGldFSKC0k9Rw2/Z3CTZ 3RkZDATVrXyVgvZYlzsuu/Diz5j8ak9RbFwfN+z4= 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.19 204/276] arm64: cpu_ops: fix a leaked reference by adding missing of_node_put Date: Wed, 29 May 2019 20:06:02 -0700 Message-Id: <20190530030537.889697689@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030523.133519668@linuxfoundation.org> References: <20190530030523.133519668@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 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