linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jimmy Li <coder.liss@gmail.com>
To: Jingoo Han <jg1.han@samsung.com>
Cc: 'Jonathan Cameron' <jic23@kernel.org>,
	'Greg Kroah-Hartman' <gregkh@linuxfoundation.org>,
	'Lars-Peter Clausen' <lars@metafoo.de>,
	'Sachin Kamat' <sachin.kamat@linaro.org>,
	'Monam Agarwal' <monamagarwal123@gmail.com>,
	linux-iio@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging:iio:ad2s1210 fix a leak when device removed
Date: Tue, 29 Apr 2014 14:29:50 +0800	[thread overview]
Message-ID: <20140429062950.GA24666@gmail.com> (raw)
In-Reply-To: <001401cf6371$3e98cf90$bbca6eb0$%han@samsung.com>

On Tue, Apr 29, 2014 at 03:07:04PM +0900, Jingoo Han wrote:
> On Tuesday, April 29, 2014 2:56 PM, Jimmy Li wrote:
> > 
> > Signed-off-by: Jimmy Li <coder.liss@gmail.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

Thank you for your reply,

I understand it now, just ignore this patch.

> 
> Best regards,
> Jingoo Han
> > 
> >  	return 0;
> >  }
> > --
> > 1.7.9.5
> 

      reply	other threads:[~2014-04-29  6:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-29  5:55 [PATCH] staging:iio:ad2s1210 fix a leak when device removed Jimmy Li
2014-04-29  6:07 ` Jingoo Han
2014-04-29  6:29   ` Jimmy Li [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140429062950.GA24666@gmail.com \
    --to=coder.liss@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jg1.han@samsung.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=monamagarwal123@gmail.com \
    --cc=sachin.kamat@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).