From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Lin Tzu Yang <rongh7426@gmail.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: dummy: free the sw device on configfs release
Date: Thu, 3 Dec 2026 13:19:22 +0200 [thread overview]
Message-ID: <axFQOkZurmA-2USI@ashevche-desk.local> (raw)
In-Reply-To: <20261202101313.944902-1-rongh7426@gmail.com>
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@intel.com>
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2026-12-03 11:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 10:13 Lin Tzu Yang
2026-12-03 11:19 ` Andy Shevchenko [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=axFQOkZurmA-2USI@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=rongh7426@gmail.com \
/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
all inboxes | Powered by JetHome®