[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <001401cf6371$3e98cf90$bbca6eb0$%han@samsung.com>
Date: Tue, 29 Apr 2014 15:07:04 +0900
From: Jingoo Han <jg1.han@...sung.com>
To: 'Jimmy Li' <coder.liss@...il.com>
Cc: 'Jonathan Cameron' <jic23@...nel.org>,
'Greg Kroah-Hartman' <gregkh@...uxfoundation.org>,
'Lars-Peter Clausen' <lars@...afoo.de>,
'Sachin Kamat' <sachin.kamat@...aro.org>,
'Monam Agarwal' <monamagarwal123@...il.com>,
linux-iio@...r.kernel.org, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org, 'Jingoo Han' <jg1.han@...sung.com>
Subject: Re: [PATCH] staging:iio:ad2s1210 fix a leak when device removed
On Tuesday, April 29, 2014 2:56 PM, Jimmy Li wrote:
>
> Signed-off-by: Jimmy Li <coder.liss@...il.com>
> ---
> drivers/staging/iio/resolver/ad2s1210.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c
> index 7fbaba4..3d6e123 100644
> --- a/drivers/staging/iio/resolver/ad2s1210.c
> +++ b/drivers/staging/iio/resolver/ad2s1210.c
> @@ -716,6 +716,7 @@ static int ad2s1210_remove(struct spi_device *spi)
>
> iio_device_unregister(indio_dev);
> ad2s1210_free_gpios(iio_priv(indio_dev));
> + devm_iio_device_free(&spi->dev, indio_dev);
NAK.
In ad2s1210_probe(),devm_iio_device_alloc() was already used.
So, when ad2s1210_remove() is called, iio_device_free() will
be called automatically. So, the leak never happens.
If you want to know about devm_* functions, please refer
to the following.
Documentation/driver-model/devres.txt
Best regards,
Jingoo Han
>
> return 0;
> }
> --
> 1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists