From: Jonathan Cameron <jic23@kernel.org>
To: Himangi Saraogi <himangi774@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-iio@vger.kernel.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Cc: Julia Lawall <julia.lawall@lip6.fr>,
Lars-Peter Clausen <lars@metafoo.de>
Subject: Re: question regarding drivers/staging/iio/adc/ad7280a.c
Date: Tue, 15 Jul 2014 18:31:27 +0100 [thread overview]
Message-ID: <53C5656F.9030200@kernel.org> (raw)
In-Reply-To: <CAB78YHwneVuVBPujeKE=rEygvtyn=VvtLtd75+pvwqxPxYcB6g@mail.gmail.com>
On 14/07/14 21:31, Himangi Saraogi wrote:
> Hi,
>
> The code seems to have a memory leak. The function ad7280_attr_init
> calls kasprintf a number of times, which calls kmalloc (or more
> precisely kmalloc_track_caller), but this data does not ever seem to
> be freed. I propose to introduce a devm_ version of kasprintf, which
> will be useful for other files also. I am not very sure that will it
> be useful to introduce a bunch of kfrees, just to remove the memory
> leaks immediately, but I think it would be safer just to devm
> everything, so then one is sure that everything is freed as it should
> be, in the right order.
>
The question here is whether such a memory leak squashing would be
worth applying to stable. Personally I'd go with no. In which case
feel free to fix it via the introduction of a devm version.
Jonathan
> Thanks
> Himangi
next prev parent reply other threads:[~2014-07-15 17:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-14 20:31 question regarding drivers/staging/iio/adc/ad7280a.c Himangi Saraogi
2014-07-15 17:31 ` Jonathan Cameron [this message]
2014-07-16 11:14 ` Lars-Peter Clausen
2014-07-17 18:10 ` Himangi Saraogi
2014-07-17 20:58 ` Greg Kroah-Hartman
2014-07-18 1:27 ` Greg Kroah-Hartman
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=53C5656F.9030200@kernel.org \
--to=jic23@kernel.org \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=himangi774@gmail.com \
--cc=julia.lawall@lip6.fr \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.