fbdev: fbcon: Destroy mutex on freeing struct fb_info
authorShigeru Yoshida <syoshida@redhat.com>
Sun, 21 Aug 2022 11:17:31 +0000 (20:17 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2022 09:30:01 +0000 (11:30 +0200)
[ Upstream commit 58559dfc1ebba2ae0c7627dc8f8991ae1984c6e3 ]

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>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/video/fbdev/core/fbsysfs.c

index ce69939..09ee27e 100644 (file)
@@ -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);
 }