Skip to contentSkip to conversation

thermal: qcom: add missing put_device() call in init_common()

PATCH Applied Jian Dong 2 participants 2 messages Mar 23, 2021 – May 26, 2021

Subsystems (3)
lore
Share & tools
lore

Jian Dong

author
#0 lore raw

PATCH 1/1 thermal: qcom: add missing put_device() call in init_common()

From: Jian Dong <[email protected]>

Fixes coccicheck ERROR:

drivers/thermal/qcom/tsens.c:759:4-10: ERROR: missing put_device; call of_find_device_by_node on line 715, but without a corresponding object release within this function.

---
 drivers/thermal/qcom/tsens.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/thermal/qcom/tsens.c +4 -2
index d8ce3a6..3c4c051 100644
@@ -755,8 +755,10 @@ int __init init_common(struct tsens_priv *priv)
 		for (i = VER_MAJOR; i <= VER_STEP; i++) {
 			priv->rf[i] = devm_regmap_field_alloc(dev, priv->srot_map,
 							      priv->fields[i]);
-			if (IS_ERR(priv->rf[i]))
-				return PTR_ERR(priv->rf[i]);
+			if (IS_ERR(priv->rf[i])) {
+				ret = PTR_ERR(priv->rf[i]);
+				goto err_put_device;
+			}
 		}
 		ret = regmap_field_read(priv->rf[VER_MINOR], &ver_minor);
 		if (ret)
Signature · 1 line
1.9.1
#1 lore raw
This patch was applied to qcom/linux.git (refs/heads/for-next):

Hello:

This patch was applied to qcom/linux.git (refs/heads/for-next):

Quoted 9 lines · On Tue, 23 Mar 2021 10:09:47 +0800 you wrote:

From: Jian Dong <[email protected]>

Fixes coccicheck ERROR:

drivers/thermal/qcom/tsens.c:759:4-10: ERROR: missing put_device; call of_find_device_by_node on line 715, but without a corresponding object release within this function.

[...]

Here is the summary with links:
- thermal: qcom: add missing put_device() call in init_common()

    https://git.kernel.org/qcom/c/f4136863e889

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html