drivers/video/backlight/s6e63m0.c: fix corruption storing gamma mode
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 15 Mar 2012 22:17:12 +0000 (15:17 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 16 Mar 2012 00:03:04 +0000 (17:03 -0700)
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>
drivers/video/backlight/s6e63m0.c

index e132157d8545e8dfc1c9a189c0d75b545ebb61e2..516db703dd24efa4e89a23d3d6ec3de2c432a693 100644 (file)
@@ -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;