Skip to content

Commit 460bfa6

Browse files
Dan Carpenterjic23
authored andcommitted
iio: dac: ad3552r: fix signedness bug in ad3552r_reset()
The "val" variable is used to store either negative error codes from ad3552r_read_reg_wrapper() or positive u16 values on success. It needs to be signed for the error handling to work correctly. Fixes: 8f2b548 ("drivers:iio:dac: Add AD3552R driver support") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/20220316122354.GA16825@kili Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 3123109 commit 460bfa6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iio/dac/ad3552r.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ static int ad3552r_reset(struct ad3552r_desc *dac)
656656
{
657657
struct reg_addr_pool addr;
658658
int ret;
659-
u16 val;
659+
int val;
660660

661661
dac->gpio_reset = devm_gpiod_get_optional(&dac->spi->dev, "reset",
662662
GPIOD_OUT_LOW);

0 commit comments

Comments
 (0)