Re: [PATCH v2] counter: interrupt-cnt: use devm_mutex_init()
From: William Breathitt Gray
Date: Wed May 27 2026 - 02:57:28 EST
On Mon, May 25, 2026 at 08:11:52PM +0500, Stepan Ionichev wrote:
> interrupt_cnt_probe() calls mutex_init() but neither this driver
> nor the counter core issues a matching mutex_destroy() on unbind,
> which leaks the lock debug state when CONFIG_DEBUG_MUTEXES is
> enabled.
>
> Switch to devm_mutex_init() so the mutex is torn down in the same
> devm scope it was set up in.
>
> Fixes: a55ebd47f21f ("counter: add IRQ or GPIO based counter")
The mutex_init() code was added in 7351312632e8 ("counter:
interrupt-cnt: Protect enable/disable OPs with mutex"), so the Fixes tag
should refer to that commit.
William Breathitt Gray