Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp969375yba; Sun, 31 Mar 2019 18:39:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqzyf2jToQ22rLLfOxgHIsShE5wj5Tmy8Jq1eUCbOUo5AQpYCi+6y17d6zaO2D8koEeocSkV X-Received: by 2002:aa7:90c7:: with SMTP id k7mr59296452pfk.186.1554082781536; Sun, 31 Mar 2019 18:39:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554082781; cv=none; d=google.com; s=arc-20160816; b=0nm7A2+3KuEybVCTtDgMZGKuiZ6TEZ0KBLUSCoaxyK+FG5eLBM6i7RUdGzTeaShmoE Asecjqm2Ingz4DQUXtHNGmbM5WEv5DfxTD6a2UYnFYXGmtM/vryyVT/sc01Us96n3zL1 IplcfpfsY7nkuCVohMNv/FaGJzZVytw5iGfFwPU8JMF+JFlzKpaWpCTKdbFVnvXXB9NR oIyuWbv5UolvrXOHRqKnVun4rdQuKPGkOqhgnqTZH9fRdUBwiRXE01fEY+enGizrE1Ip vmUtp796oRlW5LfUo9KNFOereTGsX70UEnoAfWYibCGXSgpjQFycI6/E7NJ7tNLSjSHZ bNKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=l6BeDpsshmLGos0jgGIDUYTU7l1kz1mtoRUvKvCe1UQ=; b=WtW8cb3QgFtAFt91PbXUDH+cBxtwZTRE2EJjvGN66+SGmy84lCuPGnkmiayjxzbEv0 qKA6XiOqyOj/O0gOMB2LHLqGjLFnunIk2I+vBJdNs1nLQaJSw/7elA9lJJuEhQY+VOfB 24WKSA+UseOXQ04Ix2WbkJWOiJOhET/eKKEIJAtQuEOkeLieoDxRHImGZ1aIqYHEpuYu 5n3LtVuX1UX5kT6EcUntg6imQ8OCDtbDcdZwtIUIBqCB8KhIgc4Rpub/c1DAsfwbGtl0 fcv84as2ZObESp/ROeeaDidLhfTUjWqZSh2aCP49eXFUmNILXV/Lsbq3fXQj9CdonGr6 pV0g== ARC-Authentication-Results: i=1; mx.google.com; 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 v9si7426461pgr.462.2019.03.31.18.39.26; Sun, 31 Mar 2019 18:39:41 -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; 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 S1731801AbfDABih (ORCPT + 99 others); Sun, 31 Mar 2019 21:38:37 -0400 Received: from out1.zte.com.cn ([202.103.147.172]:32918 "EHLO mxct.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731692AbfDABia (ORCPT ); Sun, 31 Mar 2019 21:38:30 -0400 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 6FA75C8391160E6625DA; Mon, 1 Apr 2019 09:38:28 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x311cNbY061323; Mon, 1 Apr 2019 09:38:23 +0800 (GMT-8) (envelope-from wen.yang99@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019040109382620-7035280 ; Mon, 1 Apr 2019 09:38:26 +0800 From: Wen Yang To: linux-kernel@vger.kernel.org Cc: wang.yi59@zte.com.cn, Wen Yang , "Rafael J. Wysocki" , Viresh Kumar , linux-pm@vger.kernel.org Subject: [PATCH 7/7] cpufreq: ppc_cbe: fix possible object reference leak Date: Mon, 1 Apr 2019 09:37:54 +0800 Message-Id: <1554082674-2049-8-git-send-email-wen.yang99@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1554082674-2049-1-git-send-email-wen.yang99@zte.com.cn> References: <1554082674-2049-1-git-send-email-wen.yang99@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-04-01 09:38:26, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-04-01 09:38:23, Serialize complete at 2019-04-01 09:38:23 X-MAIL: mse01.zte.com.cn x311cNbY061323 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 41a0f0b..8414c3a 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.9.5