Staging: iio/dac/ad5064.c: signedness bug in ad5064_read_raw()
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 29 Oct 2011 07:20:42 +0000 (10:20 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 27 Nov 2011 00:38:32 +0000 (16:38 -0800)
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>
drivers/staging/iio/dac/ad5064.c

index a701063a9267d20fbe3df42a9ee4d500fd8e4e6a..867e4ab1ff63eaa436d4f6c7f5df3e003ca3a8f9 100644 (file)
@@ -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: