iio: light: signedness bug in stk3310_write_raw()
Subsystems (2)
PATCH 1/1 iio: light: signedness bug in stk3310_write_raw()
"index" needs to be signed for the error handling to work.
drivers/iio/light/stk3310.c +1 -1
@@ -370,7 +370,7 @@ static int stk3310_write_raw(struct iio_dev *indio_dev, int val, int val2, long mask) { int ret; -unsigned int index; +int index;struct stk3310_data *data =iio_priv (indio_dev);switch (mask) {
Quoted 9 lines
From: Dan Carpenter [mailto:[email protected]]
Sent: Wednesday, May 27, 2015 11:24 AM
To: Jonathan Cameron
Cc: Hartmut Knaack; Lars-Peter Clausen; Peter Meerwald; Breana, Tiberiu A; [email protected]; [email protected]
Subject: [patch] iio: light: signedness bug instk3310_write_raw()"index" needs to be signed for the error handling to work.
Thanks for this. I don't know how it slipped by our reviews.
Quoted 17 lines
Fixes be9e6229d676 ('iio: light: Add support for Sensortek STK3310')Signed-off-by Dan Carpenter <[email protected]>drivers/iio/light/stk3310.c index renamed from drivers/iio/light/stk3310.c +0
-0e79b9d8..fee4297 100644
drivers/iio/light/stk3310.c +1
-1@@ -370,7 +370,7 @@ static int stk3310_write_raw(struct iio_dev *indio_dev, int val, int val2, long mask) {int ret; -unsigned int index; +int index;struct stk3310_data *data =iio_priv (indio_dev);switch (mask) {
Quoted 4 lines · Dan Carpenter
"index" needs to be signed for the error handling to work.
Fixes be9e6229d676 ('iio: light: Add support for Sensortek STK3310')Signed-off-by Dan Carpenter <[email protected]>
Hi Dan,
Did you find this with a tool?
Daniel.
Quoted 10 lines · Daniel Baluta
Quoted 4 lines · Dan Carpenter
"index" needs to be signed for the error handling to work.
Fixes be9e6229d676 ('iio: light: Add support for Sensortek STK3310')Signed-off-by Dan Carpenter <[email protected]>Hi Dan,
Did you find this with a tool?
Yeah. This is a Smatch thing.
regards,
dan carpenter