Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp969193yba; Sun, 31 Mar 2019 18:39:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzFpKjSSQzdI2NDMBTeiHaoqibvicsJucfwVgNMtWI9sREYSOkKow2NZS7CYvycy13MM8lg X-Received: by 2002:a63:2015:: with SMTP id g21mr35006366pgg.226.1554082762449; Sun, 31 Mar 2019 18:39:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554082762; cv=none; d=google.com; s=arc-20160816; b=JcK0LeydEpsG8wJh1WD8DysBkauqPcoXbqU3kBZ0w1sUElmq+GL+YxVc8FBXNzbUkN FHwuDjUqOanUcE15tnDxapwCSJIm/Pj5q7LOxXGqpoX/bv2gKM1jLzl24PZQS7k+oMmm UdFPzJGXcdZmq65uTpcU/ieRWRKecbeXJ0MuFvVT33e/YeHicdWZw/VzQpVmdMgAyGPT LyQKlHnkrSZ9TI39Jg5/kUeKlhHys1aIS6S24cZaIE4X3W0UnyW7SaKOMwoNr1NHn0zl UBG0Atj7O13Dfne2ZW7JCnh2tOyOXrIFLqO0vG4YCOYQsIFc8eP/AnAy67tWXsHgtrSz zhfg== 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=g5U1EEkd1G5U7OcvnBi1xWYGrIabHjosKexwCKNuoqk=; b=qGNftC8QNc/CuyMckDgBxifUVWUlb0tyZtW57ppdf62x/uYO35eO5GGtDGHsZl7MFH 4FCf6C8orPpi6IbUSMYs7GtrKdjVwr2zz7X+vjTK/pzmQxkOyWe4SvcHlr8/ZddQi++9 n9O/609Zgn1W5VUqVM7KuHHtG7xYU44fD99HghesOuz5UG4SPA5REEoto4VoGXfswAeQ XdOkOMO9nP40+1YwnZ+f3y5nJNIrYEg2GUcOV9NkDP1oUBS1MjbfLLd5YHgj+XjCqKLa mj4918qMhemdi88dycWWUrqnvu2aJnw7yTShv9eTTC6WFMDFzLymhX2DInbUse8JHx2N /RJA== 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 a4si7572544pfj.17.2019.03.31.18.39.07; Sun, 31 Mar 2019 18:39:22 -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 S1731696AbfDABiX (ORCPT + 99 others); Sun, 31 Mar 2019 21:38:23 -0400 Received: from out1.zte.com.cn ([202.103.147.172]:32806 "EHLO mxct.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726893AbfDABiV (ORCPT ); Sun, 31 Mar 2019 21:38:21 -0400 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 5D3A5476B23B7291671F; Mon, 1 Apr 2019 09:38:19 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x311cFAZ061205; Mon, 1 Apr 2019 09:38:15 +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 2019040109381829-7035256 ; Mon, 1 Apr 2019 09:38:18 +0800 From: Wen Yang To: linux-kernel@vger.kernel.org Cc: wang.yi59@zte.com.cn, Wen Yang , "Rafael J. Wysocki" , Viresh Kumar , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/7] cpufreq: imx6q: fix possible object reference leak Date: Mon, 1 Apr 2019 09:37:49 +0800 Message-Id: <1554082674-2049-3-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:18, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-04-01 09:38:15, Serialize complete at 2019-04-01 09:38:15 X-MAIL: mse01.zte.com.cn x311cFAZ061205 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The call to of_node_get 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/imx6q-cpufreq.c:391:4-10: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 348, but without a corresponding object release within this function. ./drivers/cpufreq/imx6q-cpufreq.c:395:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 348, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: "Rafael J. Wysocki" Cc: Viresh Kumar Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: linux-pm@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/cpufreq/imx6q-cpufreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index a4ff09f..3e17560 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -388,11 +388,11 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev) ret = imx6ul_opp_check_speed_grading(cpu_dev); if (ret) { if (ret == -EPROBE_DEFER) - return ret; + goto put_node; dev_err(cpu_dev, "failed to read ocotp: %d\n", ret); - return ret; + goto put_node; } } else { imx6q_opp_check_speed_grading(cpu_dev); -- 2.9.5