Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp969765yba; Sun, 31 Mar 2019 18:40:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqwbZfcPQl1K2AAwX392GH5qca1tWjx0bo9UlbHE5Nwb1FmWJSqk6v2BKP5uaKYz/3HUvH1F X-Received: by 2002:a62:4d45:: with SMTP id a66mr33309253pfb.250.1554082824920; Sun, 31 Mar 2019 18:40:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554082824; cv=none; d=google.com; s=arc-20160816; b=OI+EYgl4+NVKgGARLnP8ybrU//UutuJ7JXWWuUCguDe+ek3nwxfK44y2Jy9l2EN7Cz whJA+Asw/l5ftkyqutkxVGf84wIZAdWYHArISnE65jWRrxXLJbhvu9eJqtf3GOZlQMgE Vhp5F37c49CnC14kvbPG3N2C7Gew8oXum67SBBi7nHiWLIhxfb1b7CeKgjwpzxrmyFXX 1Ukr1JyH6EO75K5MSf7h+m/MHbdKbUkqG4D4SYX5zJcg4D8IPh2dHXhNBdtLLLaTk8dU J4x96lMaB7lwE0VPJyIcq/vb+4szxGgway5/nLAt0Gg10TqKO8rjvFb1cttattV+PeFK QjvA== 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=rMGsEWhwoT6rSQ33axpRn7WALHMeCPgJj5nQiVErunw=; b=HhPzoSiozPB93fenjH6U1rWU8yHT2Nv1EG1KL5hA18qw9gwTkcSTVV3koMkjLFLBna A5vr3M59IC7yOYyr1qgT+7Ul9H/EF1AqeDaHC1jWr19KVzc02XhChk2An2CrgxaChx2r SeGKW44q+LcVWlD3xiSrMIo9aaUo40LFyoAgK5N342ACBU2cyG7UAGwQ3OktieEoQKpK YTtL/KYPSSByDH8WlLU9Ne1NbThUppy3uQTCxARszSrAVtb1MvCvaz2N+Wf5o18BCK5a KPTW7hmJmUnza4Wrpqbl/4fYwtlAKk+En+gxmZjCRUufiAsWIA67y9mB20O2xTKQoShI m/VA== 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 e2si7256303pgv.511.2019.03.31.18.40.10; Sun, 31 Mar 2019 18:40:24 -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 S1731821AbfDABiq (ORCPT + 99 others); Sun, 31 Mar 2019 21:38:46 -0400 Received: from mxhk.zte.com.cn ([63.217.80.70]:42112 "EHLO mxhk.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731711AbfDABi1 (ORCPT ); Sun, 31 Mar 2019 21:38:27 -0400 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id CB367F8CB696586F2B91; Mon, 1 Apr 2019 09:38:24 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x311cKjX061270; Mon, 1 Apr 2019 09:38:20 +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 2019040109382316-7035272 ; Mon, 1 Apr 2019 09:38:23 +0800 From: Wen Yang To: linux-kernel@vger.kernel.org Cc: wang.yi59@zte.com.cn, Wen Yang , "Rafael J. Wysocki" , Viresh Kumar , linuxppc-dev@lists.ozlabs.org, linux-pm@vger.kernel.org Subject: [PATCH 5/7] cpufreq/pasemi: fix possible object reference leak Date: Mon, 1 Apr 2019 09:37:52 +0800 Message-Id: <1554082674-2049-6-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:23, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-04-01 09:38:20, Serialize complete at 2019-04-01 09:38:20 X-MAIL: mse01.zte.com.cn x311cKjX061270 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/pasemi-cpufreq.c:212:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 147, but without a corresponding object release within this function. ./drivers/cpufreq/pasemi-cpufreq.c:220:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 147, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: "Rafael J. Wysocki" Cc: Viresh Kumar Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/cpufreq/pasemi-cpufreq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/cpufreq/pasemi-cpufreq.c b/drivers/cpufreq/pasemi-cpufreq.c index 75dfbd2..c7710c1 100644 --- a/drivers/cpufreq/pasemi-cpufreq.c +++ b/drivers/cpufreq/pasemi-cpufreq.c @@ -146,6 +146,7 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy) cpu = of_get_cpu_node(policy->cpu, NULL); + of_node_put(cpu); if (!cpu) goto out; -- 2.9.5