Commit f0e68fc3 authored by Wei Yongjun's avatar Wei Yongjun Committed by Zhang Rui

thermal: rcar: fix missing unlock on error in rcar_thermal_update_temp()

Add the missing unlock before return from function rcar_thermal_update_temp()
in the error handling case.
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
parent f6161aa1
...@@ -145,6 +145,7 @@ static int rcar_thermal_update_temp(struct rcar_thermal_priv *priv) ...@@ -145,6 +145,7 @@ static int rcar_thermal_update_temp(struct rcar_thermal_priv *priv)
struct device *dev = rcar_priv_to_dev(priv); struct device *dev = rcar_priv_to_dev(priv);
int i; int i;
int ctemp, old, new; int ctemp, old, new;
int ret = -EINVAL;
mutex_lock(&priv->lock); mutex_lock(&priv->lock);
...@@ -174,7 +175,7 @@ static int rcar_thermal_update_temp(struct rcar_thermal_priv *priv) ...@@ -174,7 +175,7 @@ static int rcar_thermal_update_temp(struct rcar_thermal_priv *priv)
if (!ctemp) { if (!ctemp) {
dev_err(dev, "thermal sensor was broken\n"); dev_err(dev, "thermal sensor was broken\n");
return -EINVAL; goto err_out_unlock;
} }
/* /*
...@@ -192,10 +193,10 @@ static int rcar_thermal_update_temp(struct rcar_thermal_priv *priv) ...@@ -192,10 +193,10 @@ static int rcar_thermal_update_temp(struct rcar_thermal_priv *priv)
dev_dbg(dev, "thermal%d %d -> %d\n", priv->id, priv->ctemp, ctemp); dev_dbg(dev, "thermal%d %d -> %d\n", priv->id, priv->ctemp, ctemp);
priv->ctemp = ctemp; priv->ctemp = ctemp;
ret = 0;
err_out_unlock:
mutex_unlock(&priv->lock); mutex_unlock(&priv->lock);
return ret;
return 0;
} }
static int rcar_thermal_get_temp(struct thermal_zone_device *zone, static int rcar_thermal_get_temp(struct thermal_zone_device *zone,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment