Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1370549ybb; Wed, 25 Mar 2020 22:36:31 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv6V3vTWsA/v8JzALrFjro067vGmvRS18ghIVJg1aD9wbCtg1PT/PJW8KtlxQhqH/XyryZf X-Received: by 2002:a05:6830:158e:: with SMTP id i14mr5349444otr.103.1585200990970; Wed, 25 Mar 2020 22:36:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585200990; cv=none; d=google.com; s=arc-20160816; b=nOqf5Aigp4jmqwHG+kCiRZk3jEEAEb41coicN13UZ9Oa3CO4lA1CeQVym+m0tvA7W9 g1F2YMWEQ4wJEniiWkdbvI+yyKHiqzePNOZNugqhnyxJXH6+8pGTrM79ychzMHByIz56 WOJ0t6h5VrvQZy8t2xtevedcBUn0aUEF7MBSdfN7r+tuS/uljvoXPd+tiQDedP8v4kPh RoBw4h5yUY+lOehOrJ8kDkOY4ME3EW5GvzTsknB1HlMdxauWBxq2URhKeYzpeXTDtrqA BUUcFjgf73+57EBeLa3bwAplUjdiVRxBgaPOaC5h9GZFNZ/++DskFg6/v0OC8zC03Ro7 hqIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=1rs9U0DWZwoGVAnvdVBrQWABSuYXgEKrZ3nXSPj9Xrk=; b=iUhuBYpb6FUK7d3gnZYHY9kekpcYVZ4DE+OAiuhHpeZDEKRjpU9vhpe6LR+EkHwwf2 IP7ChgS47Cf8HuenxDu95sS38s2aXAbw5VP5LV0rhKm9RFFvqotIp6vtB5tYvOH6rIci S/XQPMPrxCTbzkqGS2J/l3KTDTczATL1ix0M/HRpGlnYGa9k6DQzkbu1vP4Nz+/VLa7q UMCmbnhIHCdlRJydpv6FXHOxtLUYWDfGDuWpVlA08K3+MVHa8y4llYyrM/6hmF2WNlS1 N88zLLAGClErfhn/y6lNplgaMD6aaUM4LDe5OfEdH/QyQXY7eTTUeP3XsuuRwsmo5r30 f93w== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c13si609880oig.220.2020.03.25.22.36.17; Wed, 25 Mar 2020 22:36:30 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725842AbgCZFeo (ORCPT + 99 others); Thu, 26 Mar 2020 01:34:44 -0400 Received: from inva020.nxp.com ([92.121.34.13]:45978 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725819AbgCZFeo (ORCPT ); Thu, 26 Mar 2020 01:34:44 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 328CE1A0809; Thu, 26 Mar 2020 06:34:40 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 76FA41A0813; Thu, 26 Mar 2020 06:34:34 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 4451A40294; Thu, 26 Mar 2020 13:34:27 +0800 (SGT) From: Anson Huang To: rui.zhang@intel.com, daniel.lezcano@linaro.org, amit.kucheria@verdurent.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Linux-imx@nxp.com Subject: [PATCH] thermal: imx: Add missing of_node_put() Date: Thu, 26 Mar 2020 13:27:25 +0800 Message-Id: <1585200445-16461-1-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After finishing using cpu node got from of_get_cpu_node(), of_node_put() needs to be called. Signed-off-by: Anson Huang --- drivers/thermal/imx_thermal.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c index e761c9b..f7b970d 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,15 @@ 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; + goto put_node; } } - return 0; +put_node: + if (np) + of_node_put(np); + + return ret; } static void imx_thermal_unregister_legacy_cooling(struct imx_thermal_data *data) -- 2.7.4