Skip to content

Commit

Permalink
drivers/video/backlight/adp5520_bl.c: check strict_strtoul() return v…
Browse files Browse the repository at this point in the history
…alue

It should check if strict_strtoul() succeeds.

[akpm@linux-foundation.org: don't override strict_strtoul() return value]
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Liu Yuan authored and Linus Torvalds committed May 25, 2011
1 parent f06590b commit 877947b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/video/backlight/adp5520_bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,12 @@ static ssize_t adp5520_bl_daylight_max_store(struct device *dev,
const char *buf, size_t count)
{
struct adp5520_bl *data = dev_get_drvdata(dev);
int ret;

ret = strict_strtoul(buf, 10, &data->cached_daylight_max);
if (ret < 0)
return ret;

strict_strtoul(buf, 10, &data->cached_daylight_max);
return adp5520_store(dev, buf, count, ADP5520_DAYLIGHT_MAX);
}
static DEVICE_ATTR(daylight_max, 0664, adp5520_bl_daylight_max_show,
Expand Down

0 comments on commit 877947b

Please sign in to comment.