Hi,The question here is whether such a memory leak squashing would be
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