* [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
* RE: [patch] backlight: s6e63m0: corruption storing gamma mode
2012-03-02 6:56 [patch] backlight: s6e63m0: corruption storing gamma mode Dan Carpenter
@ 2012-03-05 1:20 ` Inki Dae
0 siblings, 0 replies; 2+ messages in thread
From: Inki Dae @ 2012-03-05 1:20 UTC (permalink / raw)
To: linux-fbdev
Acked-by: Inki Dae <inki.dae@samsung.com>
Thanks.
> -----Original Message-----
> From: linux-fbdev-owner@vger.kernel.org [mailto:linux-fbdev-
> owner@vger.kernel.org] On Behalf Of Dan Carpenter
> Sent: Friday, March 02, 2012 3:56 PM
> To: Richard Purdie; InKi Dae
> Cc: Florian Tobias Schandinat; linux-fbdev@vger.kernel.org; kernel-
> janitors@vger.kernel.org
> Subject: [patch] backlight: s6e63m0: 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 <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;
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [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).