From: Bartosz Golaszewski Date: Tue, 10 Nov 2020 09:42:05 +0000 (+0100) Subject: rtc: destroy mutex when releasing the device X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=0d6d7a390b32ef23d957960d3bb8586a49d6af7c;p=uclinux-h8%2Flinux.git rtc: destroy mutex when releasing the device 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 Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20201110094205.8972-1-brgl@bgdev.pl --- diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index a1b3711aaf01..e6b44b7c4ad3 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c @@ -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); }