Message ID | 20110412150009.243f6089.akpm@linux-foundation.org (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
--- a/drivers/video/backlight/adp5520_bl.c~drivers-video-backlight-adp5520_blc-check-strict_strtoul-return-value-fix +++ a/drivers/video/backlight/adp5520_bl.c @@ -211,9 +211,11 @@ static ssize_t adp5520_bl_daylight_max_s const char *buf, size_t count) { struct adp5520_bl *data = dev_get_drvdata(dev); + int ret; - if (strict_strtoul(buf, 10, &data->cached_daylight_max) < 0) - return -EINVAL; + ret = strict_strtoul(buf, 10, &data->cached_daylight_max); + if (ret < 0) + return ret; return adp5520_store(dev, buf, count, ADP5520_DAYLIGHT_MAX); }