diff options
| author | Stepan Ionichev <sozdayvek@gmail.com> | 2026-05-23 21:43:51 +0300 |
|---|---|---|
| committer | William Breathitt Gray <wbg@kernel.org> | 2026-05-28 01:12:18 +0300 |
| commit | b400c076fe4b63576fa22fbb59078b030000970c (patch) | |
| tree | 6e82a1dad6af427e6d22b549ad24088f6fa42543 | |
| parent | ee4133b921a17b239ca617e9b0c16cad1277e9fd (diff) | |
| download | linux-b400c076fe4b63576fa22fbb59078b030000970c.tar.xz | |
counter: ftm-quaddec: use devm_mutex_init()
ftm_quaddec_probe() calls mutex_init() but neither the cleanup
action nor a remove callback issues a matching mutex_destroy(),
so the lock debug state is leaked on driver unbind.
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 <sozdayvek@gmail.com>
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
Link: https://lore.kernel.org/r/20260523184351.7567-1-sozdayvek@gmail.com
Signed-off-by: William Breathitt Gray <wbg@kernel.org>
| -rw-r--r-- | drivers/counter/ftm-quaddec.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/counter/ftm-quaddec.c b/drivers/counter/ftm-quaddec.c index c47741292ae1..8455f16d62cb 100644 --- a/drivers/counter/ftm-quaddec.c +++ b/drivers/counter/ftm-quaddec.c @@ -292,7 +292,9 @@ static int ftm_quaddec_probe(struct platform_device *pdev) counter->signals = ftm_quaddec_signals; counter->num_signals = ARRAY_SIZE(ftm_quaddec_signals); - mutex_init(&ftm->ftm_quaddec_mutex); + ret = devm_mutex_init(&pdev->dev, &ftm->ftm_quaddec_mutex); + if (ret) + return ret; ftm_quaddec_init(ftm); |
