drivers/video/backlight/adp5520_bl.c: check strict_strtoul() return value

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>
This commit is contained in:
Liu Yuan 2011-05-24 17:11:12 -07:00 committed by Linus Torvalds
parent f06590bd71
commit 877947bc25

View File

@ -211,8 +211,12 @@ static ssize_t adp5520_bl_daylight_max_store(struct device *dev,
const char *buf, size_t count) const char *buf, size_t count)
{ {
struct adp5520_bl *data = dev_get_drvdata(dev); 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); return adp5520_store(dev, buf, count, ADP5520_DAYLIGHT_MAX);
} }
static DEVICE_ATTR(daylight_max, 0664, adp5520_bl_daylight_max_show, static DEVICE_ATTR(daylight_max, 0664, adp5520_bl_daylight_max_show,