backlight: s6e63m0: corruption storing gamma mode
Subsystems (3)
PATCH 1/1 backlight: s6e63m0: corruption storing gamma mode
strict_strtoul() writes a long but ->gamma_mode only has space to store an int, so on 64 bit systems we end up scribbling over ->gamma_table_count as well. I've changed it to use kstrtouint() instead.
drivers/video/backlight/s6e63m0.c +1 -1
@@ -690,7 +690,7 @@ static ssize_t s6e63m0_sysfs_store_gamma_mode(struct device *dev,struct backlight_device *bd =NULL ;int brightness, rc; - rc =strict_strtoul (buf,0 , (unsigned long *)&lcd->gamma_mode); + rc =kstrtouint (buf,0 , &lcd->gamma_mode);if (rc <0 )return rc;
Thanks.
Quoted 35 lines
-----Original Message-----
From: [email protected] [mailto:linux-fbdev- [email protected]] On Behalf Of Dan Carpenter
Sent: Friday, March 02, 2012 3:56 PM
To: Richard Purdie; InKi Dae
Cc: Florian Tobias Schandinat; [email protected]; kernel- [email protected]
Subject: [patch] backlight: s6e63m0: corruption storing gamma mode
strict_strtoul()writes a long but ->gamma_mode only has space to store an int, so on 64 bit systems we end up scribbling over ->gamma_table_count as well. I've changed it to usekstrtouint()instead.Signed-off-by Dan Carpenter <[email protected]>drivers/video/backlight/s6e63m0.c +1
-2@@ -690,7 +690,7 @@ static ssize_t s6e63m0_sysfs_store_gamma_mode(structdevice *dev, struct backlight_device *bd = NULL;int brightness, rc; - rc =strict_strtoul (buf,0 , (unsigned long *)&lcd->gamma_mode); + rc =kstrtouint (buf,0 , &lcd->gamma_mode);if (rc <0 )return rc; --To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html