linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* question regarding drivers/staging/iio/adc/ad7280a.c
@ 2014-07-14 20:31 Himangi Saraogi
  2014-07-15 17:31 ` Jonathan Cameron
  0 siblings, 1 reply; 6+ messages in thread
From: Himangi Saraogi @ 2014-07-14 20:31 UTC (permalink / raw)
  To: Jonathan Cameron, Greg Kroah-Hartman, linux-iio, devel,
	linux-kernel
  Cc: Julia Lawall

[-- Attachment #1: Type: text/plain, Size: 585 bytes --]

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.

Thanks
Himangi

[-- Attachment #2: Type: text/html, Size: 673 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-07-18  1:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-14 20:31 question regarding drivers/staging/iio/adc/ad7280a.c Himangi Saraogi
2014-07-15 17:31 ` Jonathan Cameron
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

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).