All of lore.kernel.org
 help / color / mirror / Atom feed
From: "thermal-bot for Daniel Lezcano" <tip-bot2@linutronix.de>
To: linux-pm@vger.kernel.org
Cc: kernel test robot <lkp@intel.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	rui.zhang@intel.com, amitk@kernel.org
Subject: [thermal: thermal/next] thermal/drivers/devfreq_cooling: Fix wrong return on error path
Date: Thu, 15 Apr 2021 12:04:02 -0000	[thread overview]
Message-ID: <161848824278.29796.10119141602469930229.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20210319202424.890968-1-daniel.lezcano@linaro.org>

The following commit has been merged into the thermal/next branch of thermal:

Commit-ID:     9aa80ab2c0ba67ce3281aee604b543293f71390d
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//9aa80ab2c0ba67ce3281aee604b543293f71390d
Author:        Daniel Lezcano <daniel.lezcano@linaro.org>
AuthorDate:    Fri, 19 Mar 2021 21:24:23 +01:00
Committer:     Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Thu, 15 Apr 2021 13:21:16 +02:00

thermal/drivers/devfreq_cooling: Fix wrong return on error path

The following error is reported by kbuild:

 smatch warnings:
 drivers/thermal/devfreq_cooling.c:433 of_devfreq_cooling_register_power() warn: passing zero to 'ERR_PTR'

Fix the error code by the setting the 'err' variable instead of 'cdev'.

Fixes: f8d354e821b2 ("thermal/drivers/devfreq_cooling: Use device name instead of auto-numbering")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20210319202424.890968-1-daniel.lezcano@linaro.org
---
 drivers/thermal/devfreq_cooling.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfreq_cooling.c
index fb250ac..3a788ac 100644
--- a/drivers/thermal/devfreq_cooling.c
+++ b/drivers/thermal/devfreq_cooling.c
@@ -402,7 +402,7 @@ of_devfreq_cooling_register_power(struct device_node *np, struct devfreq *df,
 	if (err < 0)
 		goto free_table;
 
-	cdev = ERR_PTR(-ENOMEM);
+	err = -ENOMEM;
 	name = kasprintf(GFP_KERNEL, "devfreq-%s", dev_name(dev));
 	if (!name)
 		goto remove_qos_req;

      reply	other threads:[~2021-04-15 12:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-17 14:31 [linux-next:master 3781/5053] drivers/thermal/devfreq_cooling.c:433 of_devfreq_cooling_register_power() warn: passing zero to 'ERR_PTR' Dan Carpenter
2021-03-17 14:31 ` Dan Carpenter
2021-03-17 14:31 ` Dan Carpenter
2021-03-19 20:24 ` [PATCH] thermal/drivers/devfreq_cooling: Fix wrong return on error path Daniel Lezcano
2021-04-15 12:04   ` thermal-bot for Daniel Lezcano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=161848824278.29796.10119141602469930229.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=amitk@kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.