Skip to contentSkip to conversation

rtc: destroy mutex when releasing the device

PATCH Applied Bartosz Golaszewski 2 participants 2 messages Nov 10, 2020 – Nov 17, 2020 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc: destroy mutex when releasing the device

From: Bartosz Golaszewski <[email protected]>

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

---
 drivers/rtc/class.c | 1 +
 1 file changed, 1 insertion(+)
drivers/rtc/class.c +1 -0
index 7c88d190c51f..e09b3f34ffdc 100644
@@ -28,6 +28,7 @@ static void rtc_device_release(struct device *dev)
 	struct rtc_device *rtc = to_rtc_device(dev);
 
 	ida_simple_remove(&rtc_ida, rtc->id);
+	mutex_destroy(&rtc->ops_lock);
 	kfree(rtc);
 }
 
Signature · 1 line
2.29.1
maintainer Applied
#1 lore raw
Quoted 2 lines · Bartosz Golaszewski

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

Applied, thanks!

[1/1] rtc: destroy mutex when releasing the device

      commit: b3527837a60a5dcd0c16c28804b6ec9b47f15947

Best regards,

Signature · 1 line
Alexandre Belloni <[email protected]>