diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-03-12 11:43:29 -0400 |
---|---|---|
committer | Zhang Rui <rui.zhang@intel.com> | 2013-03-26 10:08:08 -0400 |
commit | 4c7fa83aa5f8444662744dba82577075f11673ae (patch) | |
tree | f2fff66461a81b4cb7902eed3874b6bf6a6173d6 /drivers/thermal/db8500_thermal.c | |
parent | f534e9bf8074ca8c258a1ce0e5224372298976f9 (diff) |
thermal: db8500: Fix missing mutex_unlock() in probe error paths
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Diffstat (limited to 'drivers/thermal/db8500_thermal.c')
-rw-r--r-- | drivers/thermal/db8500_thermal.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/thermal/db8500_thermal.c b/drivers/thermal/db8500_thermal.c index 6bdcec474fb1..1e3b3bf9f993 100644 --- a/drivers/thermal/db8500_thermal.c +++ b/drivers/thermal/db8500_thermal.c | |||
@@ -419,7 +419,8 @@ static int db8500_thermal_probe(struct platform_device *pdev) | |||
419 | low_irq = platform_get_irq_byname(pdev, "IRQ_HOTMON_LOW"); | 419 | low_irq = platform_get_irq_byname(pdev, "IRQ_HOTMON_LOW"); |
420 | if (low_irq < 0) { | 420 | if (low_irq < 0) { |
421 | dev_err(&pdev->dev, "Get IRQ_HOTMON_LOW failed.\n"); | 421 | dev_err(&pdev->dev, "Get IRQ_HOTMON_LOW failed.\n"); |
422 | return low_irq; | 422 | ret = low_irq; |
423 | goto out_unlock; | ||
423 | } | 424 | } |
424 | 425 | ||
425 | ret = devm_request_threaded_irq(&pdev->dev, low_irq, NULL, | 426 | ret = devm_request_threaded_irq(&pdev->dev, low_irq, NULL, |
@@ -427,13 +428,14 @@ static int db8500_thermal_probe(struct platform_device *pdev) | |||
427 | "dbx500_temp_low", pzone); | 428 | "dbx500_temp_low", pzone); |
428 | if (ret < 0) { | 429 | if (ret < 0) { |
429 | dev_err(&pdev->dev, "Failed to allocate temp low irq.\n"); | 430 | dev_err(&pdev->dev, "Failed to allocate temp low irq.\n"); |
430 | return ret; | 431 | goto out_unlock; |
431 | } | 432 | } |
432 | 433 | ||
433 | high_irq = platform_get_irq_byname(pdev, "IRQ_HOTMON_HIGH"); | 434 | high_irq = platform_get_irq_byname(pdev, "IRQ_HOTMON_HIGH"); |
434 | if (high_irq < 0) { | 435 | if (high_irq < 0) { |
435 | dev_err(&pdev->dev, "Get IRQ_HOTMON_HIGH failed.\n"); | 436 | dev_err(&pdev->dev, "Get IRQ_HOTMON_HIGH failed.\n"); |
436 | return high_irq; | 437 | ret = high_irq; |
438 | goto out_unlock; | ||
437 | } | 439 | } |
438 | 440 | ||
439 | ret = devm_request_threaded_irq(&pdev->dev, high_irq, NULL, | 441 | ret = devm_request_threaded_irq(&pdev->dev, high_irq, NULL, |
@@ -441,7 +443,7 @@ static int db8500_thermal_probe(struct platform_device *pdev) | |||
441 | "dbx500_temp_high", pzone); | 443 | "dbx500_temp_high", pzone); |
442 | if (ret < 0) { | 444 | if (ret < 0) { |
443 | dev_err(&pdev->dev, "Failed to allocate temp high irq.\n"); | 445 | dev_err(&pdev->dev, "Failed to allocate temp high irq.\n"); |
444 | return ret; | 446 | goto out_unlock; |
445 | } | 447 | } |
446 | 448 | ||
447 | pzone->therm_dev = thermal_zone_device_register("db8500_thermal_zone", | 449 | pzone->therm_dev = thermal_zone_device_register("db8500_thermal_zone", |
@@ -449,7 +451,8 @@ static int db8500_thermal_probe(struct platform_device *pdev) | |||
449 | 451 | ||
450 | if (IS_ERR(pzone->therm_dev)) { | 452 | if (IS_ERR(pzone->therm_dev)) { |
451 | dev_err(&pdev->dev, "Register thermal zone device failed.\n"); | 453 | dev_err(&pdev->dev, "Register thermal zone device failed.\n"); |
452 | return PTR_ERR(pzone->therm_dev); | 454 | ret = PTR_ERR(pzone->therm_dev); |
455 | goto out_unlock; | ||
453 | } | 456 | } |
454 | dev_info(&pdev->dev, "Thermal zone device registered.\n"); | 457 | dev_info(&pdev->dev, "Thermal zone device registered.\n"); |
455 | 458 | ||
@@ -461,9 +464,11 @@ static int db8500_thermal_probe(struct platform_device *pdev) | |||
461 | 464 | ||
462 | platform_set_drvdata(pdev, pzone); | 465 | platform_set_drvdata(pdev, pzone); |
463 | pzone->mode = THERMAL_DEVICE_ENABLED; | 466 | pzone->mode = THERMAL_DEVICE_ENABLED; |
467 | |||
468 | out_unlock: | ||
464 | mutex_unlock(&pzone->th_lock); | 469 | mutex_unlock(&pzone->th_lock); |
465 | 470 | ||
466 | return 0; | 471 | return ret; |
467 | } | 472 | } |
468 | 473 | ||
469 | static int db8500_thermal_remove(struct platform_device *pdev) | 474 | static int db8500_thermal_remove(struct platform_device *pdev) |