Commit 4c7fa83a authored by Axel Lin's avatar Axel Lin Committed by Zhang Rui

thermal: db8500: Fix missing mutex_unlock() in probe error paths

Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
parent f534e9bf
...@@ -419,7 +419,8 @@ static int db8500_thermal_probe(struct platform_device *pdev) ...@@ -419,7 +419,8 @@ static int db8500_thermal_probe(struct platform_device *pdev)
low_irq = platform_get_irq_byname(pdev, "IRQ_HOTMON_LOW"); low_irq = platform_get_irq_byname(pdev, "IRQ_HOTMON_LOW");
if (low_irq < 0) { if (low_irq < 0) {
dev_err(&pdev->dev, "Get IRQ_HOTMON_LOW failed.\n"); dev_err(&pdev->dev, "Get IRQ_HOTMON_LOW failed.\n");
return low_irq; ret = low_irq;
goto out_unlock;
} }
ret = devm_request_threaded_irq(&pdev->dev, low_irq, NULL, ret = devm_request_threaded_irq(&pdev->dev, low_irq, NULL,
...@@ -427,13 +428,14 @@ static int db8500_thermal_probe(struct platform_device *pdev) ...@@ -427,13 +428,14 @@ static int db8500_thermal_probe(struct platform_device *pdev)
"dbx500_temp_low", pzone); "dbx500_temp_low", pzone);
if (ret < 0) { if (ret < 0) {
dev_err(&pdev->dev, "Failed to allocate temp low irq.\n"); dev_err(&pdev->dev, "Failed to allocate temp low irq.\n");
return ret; goto out_unlock;
} }
high_irq = platform_get_irq_byname(pdev, "IRQ_HOTMON_HIGH"); high_irq = platform_get_irq_byname(pdev, "IRQ_HOTMON_HIGH");
if (high_irq < 0) { if (high_irq < 0) {
dev_err(&pdev->dev, "Get IRQ_HOTMON_HIGH failed.\n"); dev_err(&pdev->dev, "Get IRQ_HOTMON_HIGH failed.\n");
return high_irq; ret = high_irq;
goto out_unlock;
} }
ret = devm_request_threaded_irq(&pdev->dev, high_irq, NULL, ret = devm_request_threaded_irq(&pdev->dev, high_irq, NULL,
...@@ -441,7 +443,7 @@ static int db8500_thermal_probe(struct platform_device *pdev) ...@@ -441,7 +443,7 @@ static int db8500_thermal_probe(struct platform_device *pdev)
"dbx500_temp_high", pzone); "dbx500_temp_high", pzone);
if (ret < 0) { if (ret < 0) {
dev_err(&pdev->dev, "Failed to allocate temp high irq.\n"); dev_err(&pdev->dev, "Failed to allocate temp high irq.\n");
return ret; goto out_unlock;
} }
pzone->therm_dev = thermal_zone_device_register("db8500_thermal_zone", pzone->therm_dev = thermal_zone_device_register("db8500_thermal_zone",
...@@ -449,7 +451,8 @@ static int db8500_thermal_probe(struct platform_device *pdev) ...@@ -449,7 +451,8 @@ static int db8500_thermal_probe(struct platform_device *pdev)
if (IS_ERR(pzone->therm_dev)) { if (IS_ERR(pzone->therm_dev)) {
dev_err(&pdev->dev, "Register thermal zone device failed.\n"); dev_err(&pdev->dev, "Register thermal zone device failed.\n");
return PTR_ERR(pzone->therm_dev); ret = PTR_ERR(pzone->therm_dev);
goto out_unlock;
} }
dev_info(&pdev->dev, "Thermal zone device registered.\n"); dev_info(&pdev->dev, "Thermal zone device registered.\n");
...@@ -461,9 +464,11 @@ static int db8500_thermal_probe(struct platform_device *pdev) ...@@ -461,9 +464,11 @@ static int db8500_thermal_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, pzone); platform_set_drvdata(pdev, pzone);
pzone->mode = THERMAL_DEVICE_ENABLED; pzone->mode = THERMAL_DEVICE_ENABLED;
out_unlock:
mutex_unlock(&pzone->th_lock); mutex_unlock(&pzone->th_lock);
return 0; return ret;
} }
static int db8500_thermal_remove(struct platform_device *pdev) static int db8500_thermal_remove(struct platform_device *pdev)
......
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