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 <bgolaszewski@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20201110094205.8972-1-brgl@bgdev.pl
This commit is contained in:
Bartosz Golaszewski 2020-11-10 10:42:05 +01:00 committed by Alexandre Belloni
parent 1bfc485b73
commit 0d6d7a390b
1 changed files with 1 additions and 0 deletions

View File

@ -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);
}