aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/gpio.c')
-rw-r--r--arch/arm/mach-omap2/gpio.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
index 9ad7d489b0de..fe626e903dea 100644
--- a/arch/arm/mach-omap2/gpio.c
+++ b/arch/arm/mach-omap2/gpio.c
@@ -60,6 +60,7 @@ static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
60 pdata->regs = kzalloc(sizeof(struct omap_gpio_reg_offs), GFP_KERNEL); 60 pdata->regs = kzalloc(sizeof(struct omap_gpio_reg_offs), GFP_KERNEL);
61 if (!pdata->regs) { 61 if (!pdata->regs) {
62 pr_err("gpio%d: Memory allocation failed\n", id); 62 pr_err("gpio%d: Memory allocation failed\n", id);
63 kfree(pdata);
63 return -ENOMEM; 64 return -ENOMEM;
64 } 65 }
65 66
@@ -121,6 +122,7 @@ static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
121 break; 122 break;
122 default: 123 default:
123 WARN(1, "Invalid gpio bank_type\n"); 124 WARN(1, "Invalid gpio bank_type\n");
125 kfree(pdata->regs);
124 kfree(pdata); 126 kfree(pdata);
125 return -EINVAL; 127 return -EINVAL;
126 } 128 }