linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] backlight: s6e63m0: corruption storing gamma mode
@ 2012-03-02  6:56 Dan Carpenter
  2012-03-05  1:20 ` Inki Dae
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-03-02  6:56 UTC (permalink / raw)
  To: linux-fbdev

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>

diff --git a/drivers/video/backlight/s6e63m0.c b/drivers/video/backlight/s6e63m0.c
index 9b0092e..e264f55 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;
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-05  1:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-02  6:56 [patch] backlight: s6e63m0: corruption storing gamma mode Dan Carpenter
2012-03-05  1:20 ` Inki Dae

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).