From: Inki Dae <inki.dae@samsung.com>
To: linux-fbdev@vger.kernel.org
Subject: RE: [patch] backlight: s6e63m0: corruption storing gamma mode
Date: Mon, 05 Mar 2012 01:20:02 +0000 [thread overview]
Message-ID: <001c01ccfa6e$170a0160$451e0420$%dae@samsung.com> (raw)
In-Reply-To: <20120302065620.GC24508@elgon.mountain>
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
prev parent reply other threads:[~2012-03-05 1:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-02 6:56 [patch] backlight: s6e63m0: corruption storing gamma mode Dan Carpenter
2012-03-05 1:20 ` Inki Dae [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='001c01ccfa6e$170a0160$451e0420$%dae@samsung.com' \
--to=inki.dae@samsung.com \
--cc=linux-fbdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).