diff options
Diffstat (limited to 'arch/arm/mach-omap2/gpio.c')
| -rw-r--r-- | arch/arm/mach-omap2/gpio.c | 5 | 
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c index 9ad7d489b0d..2bd24671bcf 100644 --- a/arch/arm/mach-omap2/gpio.c +++ b/arch/arm/mach-omap2/gpio.c @@ -21,9 +21,10 @@  #include <linux/slab.h>  #include <linux/interrupt.h>  #include <linux/of.h> +#include <linux/platform_data/gpio-omap.h>  #include <plat/omap_hwmod.h> -#include <plat/omap_device.h> +#include "omap_device.h"  #include <plat/omap-pm.h>  #include "powerdomain.h" @@ -60,6 +61,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 +123,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;  	}  |