Skip to contentSkip to conversation

fbcon: Destroy mutex on freeing struct fb_info

PATCH Applied Shigeru Yoshida 2 participants 2 messages Aug 21, 2022 – Aug 22, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fbcon: Destroy mutex on freeing struct fb_info

It's needed to destroy bl_curve_mutex on freeing struct fb_info since the mutex is embedded in the structure and initialized when it's allocated.

---
 drivers/video/fbdev/core/fbsysfs.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/video/fbdev/core/fbsysfs.c +4 -0
index c2a60b187467..4d7f63892dcc 100644
@@ -84,6 +84,10 @@ void framebuffer_release(struct fb_info *info)
 	if (WARN_ON(refcount_read(&info->count)))
 		return;
 
+#if IS_ENABLED(CONFIG_FB_BACKLIGHT)
+	mutex_destroy(&info->bl_curve_mutex);
+#endif
+
 	kfree(info->apertures);
 	kfree(info);
 }
Signature · 1 line
2.37.2
maintainer Applied
#1 lore raw
Quoted 5 lines · Shigeru Yoshida

It's needed to destroy bl_curve_mutex on freeing struct fb_info since the mutex is embedded in the structure and initialized when it's allocated.

applied.
Thanks,
Helge

Quoted 19 lines
---
 drivers/video/fbdev/core/fbsysfs.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/video/fbdev/core/fbsysfs.c +4 -0
index c2a60b187467..4d7f63892dcc 100644
@@ -84,6 +84,10 @@ void framebuffer_release(struct fb_info *info)
 	if (WARN_ON(refcount_read(&info->count)))
 		return;
 
+#if IS_ENABLED(CONFIG_FB_BACKLIGHT)
+	mutex_destroy(&info->bl_curve_mutex);
+#endif
+
 	kfree(info->apertures);
 	kfree(info);
 }