Re: [PATCH] counter: interrupt-cnt: use devm_mutex_init()

From: Joshua Crofts

Date: Sat May 23 2026 - 16:54:43 EST


On Sat, 23 May 2026 at 20:44, Stepan Ionichev <sozdayvek@xxxxxxxxx> wrote:
>
> interrupt_cnt_probe() calls mutex_init() but neither this driver
> nor the counter core issues a matching mutex_destroy() on unbind,
> so the lock debug state is leaked.

A little bit of a misconception, however unless you compile the kernel
with CONFIG_DEBUG_MUTEXES enabled, mutex_destroy() will translate
into a nop, so there won't be any leaks. Nevertheless, the devm_
counterpart makes debugging easier, therefore

Reviewed-by: Joshua Crofts <joshua.crofts1@xxxxxxxxx>

--
Kind regards

CJD