Skip to content

Commit

Permalink
thermal: db8500: Fix missing mutex_unlock() in probe error paths
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
  • Loading branch information
Axel Lin authored and Zhang Rui committed Mar 26, 2013
1 parent f534e9b commit 4c7fa83
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions drivers/thermal/db8500_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,37 +419,40 @@ static int db8500_thermal_probe(struct platform_device *pdev)
low_irq = platform_get_irq_byname(pdev, "IRQ_HOTMON_LOW");
if (low_irq < 0) {
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,
prcmu_low_irq_handler, IRQF_NO_SUSPEND | IRQF_ONESHOT,
"dbx500_temp_low", pzone);
if (ret < 0) {
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");
if (high_irq < 0) {
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,
prcmu_high_irq_handler, IRQF_NO_SUSPEND | IRQF_ONESHOT,
"dbx500_temp_high", pzone);
if (ret < 0) {
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",
ptrips->num_trips, 0, pzone, &thdev_ops, NULL, 0, 0);

if (IS_ERR(pzone->therm_dev)) {
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");

Expand All @@ -461,9 +464,11 @@ static int db8500_thermal_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, pzone);
pzone->mode = THERMAL_DEVICE_ENABLED;

out_unlock:
mutex_unlock(&pzone->th_lock);

return 0;
return ret;
}

static int db8500_thermal_remove(struct platform_device *pdev)
Expand Down

0 comments on commit 4c7fa83

Please sign in to comment.