Re: [PATCH] Staging: iio/adc: Fixed use of obsolete function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 23, 2011 at 04:33:41PM +0100, Andreas Ruprecht wrote:
> diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
> index 372d059..319b1c6 100644
> --- a/drivers/staging/iio/adc/ad7280a.c
> +++ b/drivers/staging/iio/adc/ad7280a.c
> @@ -458,7 +458,7 @@ static ssize_t ad7280_store_balance_timer(struct device *dev,
>  	long val;
>  	int ret;
>  
> -	ret = strict_strtoul(buf, 10, &val);
> +	ret = kstrtoul(buf, 10, &val);

When you're doing these, double check that the type of the variable
matches the funcion.  kstrtoul() expects an unsigned long, but val
is signed.

It's a small bug.  val should be changed to unsigned long.  Later on
we cap the upper values of val, but we don't check whether it is
negative.

regards,
dan carpenter

Attachment: signature.asc
Description: Digital signature

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux