Skip to content

Commit

Permalink
Staging: iio/dac/ad5064.c: signedness bug in ad5064_read_raw()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Nov 27, 2011
1 parent c8a9f80 commit 23a3b8c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/iio/dac/ad5064.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 23a3b8c

Please sign in to comment.