From: Stepan Ionichev Date: Sat, 23 May 2026 18:44:18 +0000 (+0500) Subject: counter: interrupt-cnt: use devm_mutex_init() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d9a902be374aea023f2193f729c26612e56b542;p=thirdparty%2Flinux.git counter: interrupt-cnt: use devm_mutex_init() 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. Switch to devm_mutex_init() so the mutex is torn down in the same devm scope it was set up in. Signed-off-by: Stepan Ionichev Reviewed-by: Joshua Crofts Link: https://lore.kernel.org/r/20260523184418.7586-1-sozdayvek@gmail.com Signed-off-by: William Breathitt Gray --- diff --git a/drivers/counter/interrupt-cnt.c b/drivers/counter/interrupt-cnt.c index e6100b5fb082..cd475382ab6a 100644 --- a/drivers/counter/interrupt-cnt.c +++ b/drivers/counter/interrupt-cnt.c @@ -233,7 +233,9 @@ static int interrupt_cnt_probe(struct platform_device *pdev) if (ret) return ret; - mutex_init(&priv->lock); + ret = devm_mutex_init(dev, &priv->lock); + if (ret) + return ret; ret = devm_counter_add(dev, counter); if (ret < 0)