diff options
author | Aaro Koskinen <aaro.koskinen@nokia.com> | 2011-04-26 05:25:21 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-05-03 05:38:02 -0400 |
commit | 0c49cc167c6365a1a514b1e44d7fa8378ff16c4c (patch) | |
tree | 292778e87fa97b85a62e7915aa25e243886a9270 /arch/arm/mach-omap2/smartreflex.c | |
parent | da9e7392f4b0c295a47ec7def38629959eb51ff2 (diff) |
OMAP3+: smartreflex: fix ioremap leak on probe error
Add missing iounmap() to error paths.
Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/smartreflex.c')
-rw-r--r-- | arch/arm/mach-omap2/smartreflex.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index 703143a8700b..156807eaadaa 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c | |||
@@ -904,7 +904,7 @@ static int __init omap_sr_probe(struct platform_device *pdev) | |||
904 | vdd_dbg_dir = omap_voltage_get_dbgdir(sr_info->voltdm); | 904 | vdd_dbg_dir = omap_voltage_get_dbgdir(sr_info->voltdm); |
905 | if (!vdd_dbg_dir) { | 905 | if (!vdd_dbg_dir) { |
906 | ret = -EINVAL; | 906 | ret = -EINVAL; |
907 | goto err_release_region; | 907 | goto err_iounmap; |
908 | } | 908 | } |
909 | 909 | ||
910 | sr_info->dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir); | 910 | sr_info->dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir); |
@@ -912,7 +912,7 @@ static int __init omap_sr_probe(struct platform_device *pdev) | |||
912 | dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n", | 912 | dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n", |
913 | __func__); | 913 | __func__); |
914 | ret = PTR_ERR(sr_info->dbg_dir); | 914 | ret = PTR_ERR(sr_info->dbg_dir); |
915 | goto err_release_region; | 915 | goto err_iounmap; |
916 | } | 916 | } |
917 | 917 | ||
918 | (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR, | 918 | (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR, |
@@ -929,7 +929,7 @@ static int __init omap_sr_probe(struct platform_device *pdev) | |||
929 | dev_err(&pdev->dev, "%s: Unable to create debugfs directory" | 929 | dev_err(&pdev->dev, "%s: Unable to create debugfs directory" |
930 | "for n-values\n", __func__); | 930 | "for n-values\n", __func__); |
931 | ret = PTR_ERR(nvalue_dir); | 931 | ret = PTR_ERR(nvalue_dir); |
932 | goto err_release_region; | 932 | goto err_iounmap; |
933 | } | 933 | } |
934 | 934 | ||
935 | omap_voltage_get_volttable(sr_info->voltdm, &volt_data); | 935 | omap_voltage_get_volttable(sr_info->voltdm, &volt_data); |
@@ -939,7 +939,7 @@ static int __init omap_sr_probe(struct platform_device *pdev) | |||
939 | "entries for n-values\n", | 939 | "entries for n-values\n", |
940 | __func__, sr_info->voltdm->name); | 940 | __func__, sr_info->voltdm->name); |
941 | ret = -ENODATA; | 941 | ret = -ENODATA; |
942 | goto err_release_region; | 942 | goto err_iounmap; |
943 | } | 943 | } |
944 | 944 | ||
945 | for (i = 0; i < sr_info->nvalue_count; i++) { | 945 | for (i = 0; i < sr_info->nvalue_count; i++) { |
@@ -953,6 +953,8 @@ static int __init omap_sr_probe(struct platform_device *pdev) | |||
953 | 953 | ||
954 | return ret; | 954 | return ret; |
955 | 955 | ||
956 | err_iounmap: | ||
957 | iounmap(sr_info->base); | ||
956 | err_release_region: | 958 | err_release_region: |
957 | release_mem_region(mem->start, resource_size(mem)); | 959 | release_mem_region(mem->start, resource_size(mem)); |
958 | err_free_devinfo: | 960 | err_free_devinfo: |