diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-02-22 13:22:39 +0000 |
---|---|---|
committer | Zhang Rui <rui.zhang@intel.com> | 2013-03-11 23:08:33 +0800 |
commit | f0e68fc3caf677e834f7bd0f601800e686b56c98 (patch) | |
tree | 9be674d6a52d8b0bd020fd7278ac40faabd564aa /drivers/thermal/rcar_thermal.c | |
parent | f6161aa153581da4a3867a2d1a7caf4be19b6ec9 (diff) | |
download | linux-f0e68fc3caf677e834f7bd0f601800e686b56c98.tar.gz linux-f0e68fc3caf677e834f7bd0f601800e686b56c98.tar.bz2 linux-f0e68fc3caf677e834f7bd0f601800e686b56c98.zip |
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: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Diffstat (limited to 'drivers/thermal/rcar_thermal.c')
-rw-r--r-- | drivers/thermal/rcar_thermal.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c index 28f091994013..04a5566b1723 100644 --- a/drivers/thermal/rcar_thermal.c +++ b/drivers/thermal/rcar_thermal.c @@ -145,6 +145,7 @@ static int rcar_thermal_update_temp(struct rcar_thermal_priv *priv) struct device *dev = rcar_priv_to_dev(priv); int i; int ctemp, old, new; + int ret = -EINVAL; mutex_lock(&priv->lock); @@ -174,7 +175,7 @@ static int rcar_thermal_update_temp(struct rcar_thermal_priv *priv) if (!ctemp) { 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) dev_dbg(dev, "thermal%d %d -> %d\n", priv->id, priv->ctemp, ctemp); priv->ctemp = ctemp; - + ret = 0; +err_out_unlock: mutex_unlock(&priv->lock); - - return 0; + return ret; } static int rcar_thermal_get_temp(struct thermal_zone_device *zone, |