Re: [PATCH] gpio/omap: fix possible memory leak in omap2_gpio_dev_init()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 03, 2012 at 06:13:33PM +0800, Wei Yongjun wrote:
> @@ -130,6 +132,7 @@ static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
>  
>  	pdev = omap_device_build(name, id - 1, oh, pdata,
>  				sizeof(*pdata),	NULL, 0, false);
> +	kfree(pdata->regs);
>  	kfree(pdata);

This one looks wrong.  pdata is copied by the internals of
omap_device_build(), which includes the 'regs' pointer, so it should not
be freed after a successful call to omap_device_build().  (It should,
however, be freed after an unsuccessful call.)

BTW, you want to copy Paul Walmsley with this patch (address in Cc).
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux