Skip to content

Commit d16d1c2

Browse files
rbuisson-invnjic23
authored andcommitted
iio: imu: inv_icm45600: Initializes inv_icm45600_buffer_postdisable() sleep
The sleep variable in inv_icm45600_buffer_postdisable() could be used without being assigned in case of error. It must be initialized to 0 by default. Fixes: 06674a7 ("iio: imu: inv_icm45600: add buffer support in iio devices") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/linux-iio/aPi6Xw-ZoUkW76zR@stanley.mountain/ Signed-off-by: Remi Buisson <remi.buisson@tdk.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent 9eb98a0 commit d16d1c2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/iio/imu/inv_icm45600/inv_icm45600_buffer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ static int inv_icm45600_buffer_postdisable(struct iio_dev *indio_dev)
370370
return -EINVAL;
371371
}
372372

373+
sleep = 0;
373374
scoped_guard(mutex, &st->lock)
374375
ret = _inv_icm45600_buffer_postdisable(st, sensor, watermark, &sleep);
375376

0 commit comments

Comments
 (0)