+ backlight-fix-oops-in-__mutex_lock_slowpath-during-head-sys-class-graphics-fb0.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     backlight: fix oops in __mutex_lock_slowpath during head /sys/class/graphics/fb0/*

has been added to the -mm tree.  Its filename is

     backlight-fix-oops-in-__mutex_lock_slowpath-during-head-sys-class-graphics-fb0.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: backlight: fix oops in __mutex_lock_slowpath during head /sys/class/graphics/fb0/*
From: Michael Hanselmann <linux-kernel@xxxxxxxxx>

Seems like not all drivers use the framebuffer_alloc() function and won't
have an initialized mutex.  But those don't have a backlight, anyway.

Signed-off-by: Michael Hanselmann <linux-kernel@xxxxxxxxx>
Cc: Olaf Hering <olaf@xxxxxxxxx>
Cc: "Antonino A. Daplas" <adaplas@xxxxxxx>
Cc: Daniel R Thompson <daniel.thompson@xxxxxx>
Cc: Jon Smirl <jonsmirl@xxxxxxxxx>
Cc: <stable@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/video/fbsysfs.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff -puN drivers/video/fbsysfs.c~backlight-fix-oops-in-__mutex_lock_slowpath-during-head-sys-class-graphics-fb0 drivers/video/fbsysfs.c
--- a/drivers/video/fbsysfs.c~backlight-fix-oops-in-__mutex_lock_slowpath-during-head-sys-class-graphics-fb0
+++ a/drivers/video/fbsysfs.c
@@ -397,6 +397,12 @@ static ssize_t store_bl_curve(struct cla
 	u8 tmp_curve[FB_BACKLIGHT_LEVELS];
 	unsigned int i;
 
+	/* Some drivers don't use framebuffer_alloc(), but those also
+	 * don't have backlights.
+	 */
+	if (!fb_info || !fb_info->bl_dev)
+		return -ENODEV;
+
 	if (count != (FB_BACKLIGHT_LEVELS / 8 * 24))
 		return -EINVAL;
 
@@ -430,6 +436,12 @@ static ssize_t show_bl_curve(struct clas
 	ssize_t len = 0;
 	unsigned int i;
 
+	/* Some drivers don't use framebuffer_alloc(), but those also
+	 * don't have backlights.
+	 */
+	if (!fb_info || !fb_info->bl_dev)
+		return -ENODEV;
+
 	mutex_lock(&fb_info->bl_mutex);
 	for (i = 0; i < FB_BACKLIGHT_LEVELS; i += 8)
 		len += snprintf(&buf[len], PAGE_SIZE,
_

Patches currently in -mm which might be from linux-kernel@xxxxxxxxx are

backlight-fix-oops-in-__mutex_lock_slowpath-during-head-sys-class-graphics-fb0.patch
apple-motion-sensor-driver-2.patch
apple-motion-sensor-driver-2-fixes-update.patch
apple-motion-sensor-driver-kconfig-fix.patch
ams-check-return-values-from-device_create_file.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux