From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Mundt Date: Thu, 07 Apr 2011 16:16:59 +0000 Subject: Re: [PATCH] drivers, video: Add a check for strict_strtoul() Message-Id: <20110407161659.GB8052@linux-sh.org> List-Id: References: <1302167178-9216-1-git-send-email-namei.unix@gmail.com> In-Reply-To: <1302167178-9216-1-git-send-email-namei.unix@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-fbdev@vger.kernel.org (Adding akpm to Cc..) On Thu, Apr 07, 2011 at 10:57:17AM +0100, Hennerich, Michael wrote: > Liu Yuan wrote on 2011-04-07: > > From: Liu Yuan > > > > It should check if strict_strtoul() succeeds.This patch fixes it. > > > > Signed-off-by: Liu Yuan > > Acked-by: Michael Hennerich > > > --- > > drivers/video/backlight/adp5520_bl.c | 4 +++- > > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/drivers/video/backlight/adp5520_bl.c > > b/drivers/video/backlight/adp5520_bl.c index af31197..fdef632 100644 --- > > a/drivers/video/backlight/adp5520_bl.c +++ > > b/drivers/video/backlight/adp5520_bl.c @@ -212,7 +212,9 @@ static > > ssize_t adp5520_bl_daylight_max_store(struct device *dev, { > > struct adp5520_bl *data = dev_get_drvdata(dev); > > - strict_strtoul(buf, 10, &data->cached_daylight_max); > > + if (strict_strtoul(buf, 10, &data->cached_daylight_max) < 0) > > + return -EINVAL; > > + > > return adp5520_store(dev, buf, count, ADP5520_DAYLIGHT_MAX); } > > static DEVICE_ATTR(daylight_max, 0664, adp5520_bl_daylight_max_show, > > Greetings, > Michael > > -- > Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen > Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368; Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin, Margaret Seif > >