aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power/avs
diff options
context:
space:
mode:
authorJean Pihet <jean.pihet@newoldbits.com>2012-09-24 10:16:40 -0400
committerKevin Hilman <khilman@ti.com>2012-10-02 17:55:31 -0400
commitce3810cdb4ca31238c87e095d2c494a5eaa4f65d (patch)
tree06e6c3e474456473c50d469cddd05e600de9a795 /drivers/power/avs
parent70071ff989bae3edfc14847aaa8e1c3baa2aacff (diff)
ARM: OMAP: SmartReflex: fix error path in init function
Fix the error handling path in omap_sr_probe to correctly de-allocate resources in case of problems. Signed-off-by: Jean Pihet <j-pihet@ti.com> Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'drivers/power/avs')
-rw-r--r--drivers/power/avs/smartreflex.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/power/avs/smartreflex.c b/drivers/power/avs/smartreflex.c
index 44efc6e202af..92f67283c965 100644
--- a/drivers/power/avs/smartreflex.c
+++ b/drivers/power/avs/smartreflex.c
@@ -928,7 +928,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
928 if (!sr_info->base) { 928 if (!sr_info->base) {
929 dev_err(&pdev->dev, "%s: ioremap fail\n", __func__); 929 dev_err(&pdev->dev, "%s: ioremap fail\n", __func__);
930 ret = -ENOMEM; 930 ret = -ENOMEM;
931 goto err_release_region; 931 goto err_free_name;
932 } 932 }
933 933
934 if (irq) 934 if (irq)
@@ -967,7 +967,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
967 dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n", 967 dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n",
968 __func__); 968 __func__);
969 ret = PTR_ERR(sr_info->dbg_dir); 969 ret = PTR_ERR(sr_info->dbg_dir);
970 goto err_free_name; 970 goto err_debugfs;
971 } 971 }
972 972
973 (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR, 973 (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR,
@@ -1011,11 +1011,11 @@ static int __init omap_sr_probe(struct platform_device *pdev)
1011 1011
1012err_debugfs: 1012err_debugfs:
1013 debugfs_remove_recursive(sr_info->dbg_dir); 1013 debugfs_remove_recursive(sr_info->dbg_dir);
1014err_free_name:
1015 kfree(sr_info->name);
1016err_iounmap: 1014err_iounmap:
1017 list_del(&sr_info->node); 1015 list_del(&sr_info->node);
1018 iounmap(sr_info->base); 1016 iounmap(sr_info->base);
1017err_free_name:
1018 kfree(sr_info->name);
1019err_release_region: 1019err_release_region:
1020 release_mem_region(mem->start, resource_size(mem)); 1020 release_mem_region(mem->start, resource_size(mem));
1021err_free_devinfo: 1021err_free_devinfo: