提交 cf2b94da 编写于 作者: D Dan Carpenter 提交者: Linus Torvalds

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: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NInki Dae <inki.dae@samsung.com>
Signed-off-by: NFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 5eb1eb4e
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册