Re: [PATCH] iio: dummy: free the sw device on configfs release
From: Andy Shevchenko
Date: Thu Dec 03 2026 - 06:19:30 EST
On Wed, Dec 02, 2026 at 06:13:13PM +0800, Lin Tzu Yang wrote:
> iio_dummy_probe() allocates the struct iio_sw_device that embeds the
> configfs group of a dummy device, but nothing frees it:
> iio_dummy_remove() frees the iio_dev only, and iio_dummy_type has no
> ->release(). Every mkdir/rmdir of a directory under
> /sys/kernel/config/iio/devices/dummy/ leaks it.
>
> Free it from the ->release() callback of the config_item_type, which
> configfs calls when the last reference to the item is dropped, as
> commit 8fb20cdf9c86 ("iio: trigger: free hrtimer and loop triggers on
> configfs release") does for the software triggers.
Sounds correct to me.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
--
With Best Regards,
Andy Shevchenko