Skip to content

Commit

Permalink
drivers/video/backlight/s6e63m0.c: fix corruption storing gamma mode
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Dan Carpenter authored and torvalds committed Mar 16, 2012
1 parent 5eb1eb4 commit cf2b94d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/video/backlight/s6e63m0.c
Expand Up @@ -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;

Expand Down

0 comments on commit cf2b94d

Please sign in to comment.