Commit 23a3b8cc authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Acked-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c8a9f805
......@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment