mirror of https://gitee.com/openkylin/linux.git
Staging: iio/dac/ad5064.c: signedness bug in ad5064_read_raw()
regulator_get_voltage() returns an int so "scale_uv" should be an int. Making it unsigned here breaks the error handling. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
c8a9f8056f
commit
23a3b8cc9c
|
@ -280,8 +280,8 @@ static int ad5064_read_raw(struct iio_dev *indio_dev,
|
|||
long m)
|
||||
{
|
||||
struct ad5064_state *st = iio_priv(indio_dev);
|
||||
unsigned long scale_uv;
|
||||
unsigned int vref;
|
||||
int scale_uv;
|
||||
|
||||
switch (m) {
|
||||
case 0:
|
||||
|
|
Loading…
Reference in New Issue