From: Dan Carpenter Date: Thu, 15 Mar 2012 22:17:12 +0000 (-0700) Subject: drivers/video/backlight/s6e63m0.c: fix corruption storing gamma mode X-Git-Tag: firefly_0821_release~3680^2~3364^2~2 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=cf2b94daab9f3d21b0a393bef91292622f6a8ca4;p=firefly-linux-kernel-4.4.55.git drivers/video/backlight/s6e63m0.c: fix 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. Signed-off-by: Dan Carpenter Acked-by: Inki Dae Signed-off-by: Florian Tobias Schandinat Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/video/backlight/s6e63m0.c b/drivers/video/backlight/s6e63m0.c index e132157d8545..516db703dd24 100644 --- a/drivers/video/backlight/s6e63m0.c +++ b/drivers/video/backlight/s6e63m0.c @@ -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;