linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtc: destroy mutex when releasing the device
@ 2020-11-10  9:42 Bartosz Golaszewski
  2020-11-17 23:01 ` Alexandre Belloni
  0 siblings, 1 reply; 2+ messages in thread
From: Bartosz Golaszewski @ 2020-11-10  9:42 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

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>
---
 drivers/rtc/class.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index 7c88d190c51f..e09b3f34ffdc 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);
 }
 
-- 
2.29.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] rtc: destroy mutex when releasing the device
  2020-11-10  9:42 [PATCH] rtc: destroy mutex when releasing the device Bartosz Golaszewski
@ 2020-11-17 23:01 ` Alexandre Belloni
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2020-11-17 23:01 UTC (permalink / raw)
  To: Bartosz Golaszewski, Alessandro Zummo
  Cc: Alexandre Belloni, linux-rtc, Bartosz Golaszewski, linux-kernel

On Tue, 10 Nov 2020 10:42:05 +0100, Bartosz Golaszewski wrote:
> 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,
-- 
Alexandre Belloni <alexandre.belloni@bootlin.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-17 23:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-10  9:42 [PATCH] rtc: destroy mutex when releasing the device Bartosz Golaszewski
2020-11-17 23:01 ` Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).