From: "thermal-bot for Dan Carpenter" <tip-bot2@linutronix.de>
To: linux-pm@vger.kernel.org
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
rui.zhang@intel.com, amitk@kernel.org
Subject: [thermal: thermal/next] thermal/of: Fix error code in of_thermal_zone_find()
Date: Tue, 23 Aug 2022 12:43:20 -0000 [thread overview]
Message-ID: <166125860068.401.6527171705353525583.tip-bot2@tip-bot2> (raw)
In-Reply-To: <YvDzovkMCQecPDjz@kili>
The following commit has been merged into the thermal/next branch of thermal:
Commit-ID: 45b8850b3d3071d5ea9e19ad4a29ad5f0b5d1ec1
Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//45b8850b3d3071d5ea9e19ad4a29ad5f0b5d1ec1
Author: Dan Carpenter <dan.carpenter@oracle.com>
AuthorDate: Tue, 09 Aug 2022 10:56:26 +02:00
Committer: Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Wed, 17 Aug 2022 14:09:37 +02:00
thermal/of: Fix error code in of_thermal_zone_find()
Currently, if we cannot find the correct thermal zone then this error
path returns NULL and it would lead to an Oops in the caller. Return
ERR_PTR(-EINVAL) instead.
Fixes: 3bd52ac87347 ("thermal/of: Rework the thermal device tree initialization")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YvDzovkMCQecPDjz@kili
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
drivers/thermal/thermal_of.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
index 82236fe..15b342f 100644
--- a/drivers/thermal/thermal_of.c
+++ b/drivers/thermal/thermal_of.c
@@ -1102,6 +1102,7 @@ static struct device_node *of_thermal_zone_find(struct device_node *sensor, int
}
}
}
+ tz = ERR_PTR(-EINVAL);
out:
of_node_put(np);
return tz;
prev parent reply other threads:[~2022-08-23 16:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-08 11:29 [PATCH] thermal/of: fix error code in of_thermal_zone_find() Dan Carpenter
2022-08-23 12:43 ` thermal-bot for Dan Carpenter [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=166125860068.401.6527171705353525583.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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox