summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiu Yuan <tailai.ly@taobao.com>2011-05-24 17:11:12 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-25 08:39:01 -0700
commit877947bc25af5964f282dea112d24934050cc7b1 (patch)
treea93075a5fe0967e4020857a35a30b727a29c9808
parentf06590bd718ed950c98828e30ef93204028f3210 (diff)
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>
-rw-r--r--drivers/video/backlight/adp5520_bl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/video/backlight/adp5520_bl.c b/drivers/video/backlight/adp5520_bl.c
index af3119707dbf..d1aee730d7d8 100644
--- a/drivers/video/backlight/adp5520_bl.c
+++ b/drivers/video/backlight/adp5520_bl.c
@@ -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,