diff mbox series

[5.10.y-cip,02/15] rtc: destroy mutex when releasing the device

Message ID 20230911144702.948246-3-biju.das.jz@bp.renesas.com (mailing list archive)
State Accepted
Headers show
Series Enable Renesas PMIC RAA215300 and RTC builtin support | expand

Commit Message

Biju Das Sept. 11, 2023, 2:46 p.m. UTC
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

commit 0d6d7a390b32ef23d957960d3bb8586a49d6af7c upstream.

Not destroying mutexes doesn't lead to resource leak but it's the correct
thing to do for mutex debugging accounting.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20201110094205.8972-1-brgl@bgdev.pl
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 drivers/rtc/class.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index 625effe6cb65..f46160d76b65 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -37,6 +37,7 @@  static void rtc_device_release(struct device *dev)
 	cancel_work_sync(&rtc->irqwork);
 
 	ida_simple_remove(&rtc_ida, rtc->id);
+	mutex_destroy(&rtc->ops_lock);
 	kfree(rtc);
 }