Re: [PATCH 4/4] mfd: palmas: fix resource leak of i2c_dummy devices

Lee Jones
2013-09-27T07:49:39Z

On Thu, 26 Sep 2013, Laxman Dewangan wrote:

> Palmas device supports multiple i2c device address and the client
> for these addressed are created in the driver as i2c_new_dummy().
>
> The new devices are not getting released in error or removal path and
> so it is causing resource leak.
>
> Add the unregister of these newly created dummy devices to avoid resource
> leaks.
>
> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
> ---
> drivers/mfd/palmas.c | 21 +++++++++++++++------
> 1 files changed, 15 insertions(+), 6 deletions(-)

Patch looks sane.

> no_irq:
> slave = PALMAS_BASE_TO_SLAVE(PALMAS_PU_PD_OD_BASE);
> @@ -552,7 +552,6 @@ no_irq:
> } else if (pdata->pm_off && !pm_power_off) {
> palmas_dev = palmas;
> pm_power_off = palmas_power_off;
> - return ret;
> }
> }

Sneaky! ;)

Applied, thanks.

--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog