Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp262982ybi; Wed, 29 May 2019 20:55:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzkjw/K05+FOzwMgrD0FumtkQE/X2y7n0EmgcoIMGZMs0bvPvW61xNvI8M04n0khgefTJib X-Received: by 2002:a17:90a:9f44:: with SMTP id q4mr1413875pjv.83.1559188552214; Wed, 29 May 2019 20:55:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559188552; cv=none; d=google.com; s=arc-20160816; b=uloBN5iquf1UXEDYONJmATg21Tpsv8cEyR9gAxf79W5y6QeTCW6xs8bykv6pLvZ3sC oxi2qqZv1rpgXmEASMM5snxcw9UJ/mfalPoZhgPWE4rdqd8utkB9TH22jEGmnxVdqZvN luHu7P3VHHbyR4OZy9L9cbAbI1XAXJqa8ACfxfPCoXt5NhcFtBAJpXtYRT+OBoOolBZK 0UDo70XF2HZmzzxSom27u8fWyNui0UU2LAq1PTzomZx8wQk358N96498La9ziWQGYDDP mpy1KQBDmPQAgKHo5ee3MJT0luS4OimXmmlgThWuCfks4hcvoCAWJRuP+pKDtwzTNY9A GGdw== 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=kGYqTdLHyZ31GGX/A77zAiIRpLYG4N8GKLD7SmLXjyk=; b=z4Hd/KnMDdFagCQN+9V1jXrwezzmfu2X1ZvURsmCL6AhPCLUZ5CJmUMKFjc+PIpKQ4 wN7TSE2XnFrRan68aHNX2BzLkKfKXRdz4ctw1t0jhv9LSBqNhfKKyWmNSKPufUSzfCj0 K8y7a5J1M/lytZsh75kUGYU+NJU7qMx8iBRJyIntWjYxV6XBhrhTCrEYrVPtMM0Kyd9p BLnCGcwDVXh8C+t7MPreCGBIiyaHbKbMQ2Dkc0PZyiE3IpVAOn+Kt2Gt5gG+zxxbdipz 6SDRvOQFoRNtQT/XpE+qb/M7wq+ixco7JGqZjF4StfxPwIuDp9OzqpiALmHkb+NgfCOs 7N9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Jw+mLu1N; 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 m189si2246603pfb.74.2019.05.29.20.55.37; Wed, 29 May 2019 20:55:52 -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=Jw+mLu1N; 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 S1732053AbfE3DxC (ORCPT + 99 others); Wed, 29 May 2019 23:53:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:55652 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731932AbfE3DTd (ORCPT ); Wed, 29 May 2019 23:19:33 -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 A3C6E24820; Thu, 30 May 2019 03:19:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559186372; bh=/9gO1owKbVSEM1J1l/p0XqI3NOncT/RkO+xEAx1EsGc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jw+mLu1NQMYQ8LmX/NMQYBjb4hathAmsul7rNDgO2YzDUAmiB89fqjmsdsv1TItc4 YPzN/Hg+I3FQQqvTBgHqhziKYd9pcUGdq4Q971DdU6yDmTzqtL2uEvK1+TQyufTWiC B/lK6kCK4h4MNmiWC4gAJqaabUhfvYN8emZ9hkeg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wen Yang , "Rafael J. Wysocki" , Viresh Kumar , linux-pm@vger.kernel.org, Sasha Levin Subject: [PATCH 4.14 130/193] cpufreq: ppc_cbe: fix possible object reference leak Date: Wed, 29 May 2019 20:06:24 -0700 Message-Id: <20190530030506.541854823@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030446.953835040@linuxfoundation.org> References: <20190530030446.953835040@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 233298032803f2802fe99892d0de4ab653bfece4 ] The call to of_get_cpu_node returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./drivers/cpufreq/ppc_cbe_cpufreq.c:89:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 76, but without a corresponding object release within this function. ./drivers/cpufreq/ppc_cbe_cpufreq.c:89:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 76, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: "Rafael J. Wysocki" Cc: Viresh Kumar Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Viresh Kumar Signed-off-by: Sasha Levin --- drivers/cpufreq/ppc_cbe_cpufreq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/cpufreq/ppc_cbe_cpufreq.c b/drivers/cpufreq/ppc_cbe_cpufreq.c index 5a4c5a639f618..2eaeebcc93afe 100644 --- a/drivers/cpufreq/ppc_cbe_cpufreq.c +++ b/drivers/cpufreq/ppc_cbe_cpufreq.c @@ -86,6 +86,7 @@ static int cbe_cpufreq_cpu_init(struct cpufreq_policy *policy) if (!cbe_get_cpu_pmd_regs(policy->cpu) || !cbe_get_cpu_mic_tm_regs(policy->cpu)) { pr_info("invalid CBE regs pointers for cpufreq\n"); + of_node_put(cpu); return -EINVAL; } -- 2.20.1