|
@@ -60,6 +60,7 @@ static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
|
|
|
pdata->regs = kzalloc(sizeof(struct omap_gpio_reg_offs), GFP_KERNEL);
|
|
|
if (!pdata->regs) {
|
|
|
pr_err("gpio%d: Memory allocation failed\n", id);
|
|
|
+ kfree(pdata);
|
|
|
return -ENOMEM;
|
|
|
}
|
|
|
|
|
@@ -121,6 +122,7 @@ static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
|
|
|
break;
|
|
|
default:
|
|
|
WARN(1, "Invalid gpio bank_type\n");
|
|
|
+ kfree(pdata->regs);
|
|
|
kfree(pdata);
|
|
|
return -EINVAL;
|
|
|
}
|