diff mbox series

fbcon: Destroy mutex on freeing struct fb_info

Message ID 20220821111731.247446-1-syoshida@redhat.com
State New
Headers show
Series fbcon: Destroy mutex on freeing struct fb_info | expand

Commit Message

Shigeru Yoshida Aug. 21, 2022, 11:17 a.m. UTC
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.

Signed-off-by: Shigeru Yoshida <syoshida@redhat.com>
---
 drivers/video/fbdev/core/fbsysfs.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Helge Deller Aug. 22, 2022, 8:09 p.m. UTC | #1
On 8/21/22 13:17, Shigeru Yoshida wrote:
> 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.
>
> Signed-off-by: Shigeru Yoshida <syoshida@redhat.com>

applied.
Thanks,
Helge

> ---
>  drivers/video/fbdev/core/fbsysfs.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/video/fbdev/core/fbsysfs.c b/drivers/video/fbdev/core/fbsysfs.c
> index c2a60b187467..4d7f63892dcc 100644
> --- a/drivers/video/fbdev/core/fbsysfs.c
> +++ b/drivers/video/fbdev/core/fbsysfs.c
> @@ -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);
>  }
diff mbox series

Patch

diff --git a/drivers/video/fbdev/core/fbsysfs.c b/drivers/video/fbdev/core/fbsysfs.c
index c2a60b187467..4d7f63892dcc 100644
--- a/drivers/video/fbdev/core/fbsysfs.c
+++ b/drivers/video/fbdev/core/fbsysfs.c
@@ -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);
 }