Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp661751ybt; Wed, 8 Jul 2020 08:42:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3dxtoKxitOIMG1vBmh4uZNMPtZp8zAEueVZlyvuHK+IuYwTW9mstFbSRWojb67NUjiLRC X-Received: by 2002:a50:d09c:: with SMTP id v28mr63370062edd.58.1594222941048; Wed, 08 Jul 2020 08:42:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594222941; cv=none; d=google.com; s=arc-20160816; b=Qb6K7CcgJhDIRWiSc4XnfDA4XQ/6qtB3P8EAsaDgyPT8PGMnW5mc4qTG+cPH8PJ+Iu AhuLIBvTe2vGZcmQyaE+beqEHUvSJxZFT/4DeKha+pO0a9gzMZNYXL6n8D+taEl6+prt WdXG+lyEOZjTO2v8aDfI6o+F74T+cZsZtePo520qqwYBNCck1RIqh2URb4F60bm0aPPn p2tYe5AT4VUzsHtJ5YC2fijacZZdmJBCSNVbVBVfPZKgtGU0ynak6zN5USXZ+hb62Kqt EzO9vU1izG/Wdl7QENp9/uQgJzE8lE/cWaagYo6V+SkILxvzZZd46khJO3Gaeq+3HQ+7 94ww== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NVu6yfyCNZLMq3hx1pzd2wj4riHJ0cE6rjqNzUvWNXo=; b=j8Q+QG5lHgNpwZSdKoqbSx0k4vVWuKDCcSWhzZ1qESkDbMfzvgbmRWlIUIoSiMKkMd 7jyMh7xVZFFTJecYSh6Tw3Ckg1r6TJSxlooNYc8iFbONcwRtpTPKGNlpu2aQxs4IEpkP 6yIDDskYe+qVB88HPdb+FCSdx6aQjnaQ4KgC4XbGPAcFtkE5MYBwnmnUdY+z62/nxoIH 3E0G46l9yV8iYw49DgHxE5fYqnxPJjSCb/V4yAaphKeFbFPpRmh8G0b7/KN6KYy4FqT9 DIZu0bchILi7iWHEwNYdG2dCe4PUWQDvsDQci2iQg+79uZ236CPZvqz5yOWPjWnQENIF XBXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=f9XBuGan; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gz3si141336ejb.142.2020.07.08.08.41.57; Wed, 08 Jul 2020 08:42:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=f9XBuGan; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730449AbgGHPla (ORCPT + 99 others); Wed, 8 Jul 2020 11:41:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:48000 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730428AbgGHPl3 (ORCPT ); Wed, 8 Jul 2020 11:41:29 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2AF472080D; Wed, 8 Jul 2020 15:41:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594222888; bh=jXwzaznj6HnmZcyrThYwe2ObKGTHQE4RcAMYcZSIg7w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f9XBuGanihJXIBncmdLzS8p1kJBXykiwoUN2nCSsXqUsRIe+nmHDyUrwEbK5cnItI pIjKSb9DZIHwI79Um88HLjXNHKyXoi77rSltowOhOa1QD4Z3fteth/+wiC8o3bgz2e zgOCydIdcz/RB6/M1zXTu7s+V17ssrWJiXaUqNM8= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Anson Huang , Daniel Lezcano , Sasha Levin , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.7 09/30] thermal/drivers: imx: Fix missing of_node_put() at probe time Date: Wed, 8 Jul 2020 11:40:55 -0400 Message-Id: <20200708154116.3199728-9-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200708154116.3199728-1-sashal@kernel.org> References: <20200708154116.3199728-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anson Huang [ Upstream commit b45fd13be340e4ed0a2a9673ba299eb2a71ba829 ] After finishing using cpu node got from of_get_cpu_node(), of_node_put() needs to be called. Signed-off-by: Anson Huang Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/1585232945-23368-1-git-send-email-Anson.Huang@nxp.com Signed-off-by: Sasha Levin --- drivers/thermal/imx_thermal.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c index e761c9b422179..1b84ea674edb7 100644 --- a/drivers/thermal/imx_thermal.c +++ b/drivers/thermal/imx_thermal.c @@ -649,7 +649,7 @@ MODULE_DEVICE_TABLE(of, of_imx_thermal_match); static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data) { struct device_node *np; - int ret; + int ret = 0; data->policy = cpufreq_cpu_get(0); if (!data->policy) { @@ -664,11 +664,12 @@ static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data) if (IS_ERR(data->cdev)) { ret = PTR_ERR(data->cdev); cpufreq_cpu_put(data->policy); - return ret; } } - return 0; + of_node_put(np); + + return ret; } static void imx_thermal_unregister_legacy_cooling(struct imx_thermal_data *data) -- 2.25.1