1
0
Fork 0
alistair23-linux/tools/iio
Martin Kelly b119d3bc32 tools: iio: iio_generic_buffer: make num_loops signed
Currently, num_loops is unsigned, but it's set by strtoll, which returns a
(signed) long long int. This could lead to overflow, and it also makes the
check "num_loops < 0" always be false, since num_loops is unsigned.
Setting num_loops to -1 to loop forever is almost working because num_loops
is getting set to a very high number, but it's technically still incorrect.

Fix this issue by making num_loops signed. This also fixes an error found
by Smatch.

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 55dda0abcf ("tools: iio: iio_generic_buffer: allow continuous looping")
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-01-12 18:17:56 +00:00
..
Build iio: tools: move to tools buildsystem 2017-08-09 14:29:36 +01:00
Makefile tools iio: Override CFLAGS assignments 2018-10-21 13:25:42 +01:00
iio_event_monitor.c iio: Add modifier for DUV light 2018-07-23 19:18:10 +01:00
iio_generic_buffer.c tools: iio: iio_generic_buffer: make num_loops signed 2019-01-12 18:17:56 +00:00
iio_utils.c iio: iio-utils: use channel modifier scaling if it exists 2016-08-29 16:26:41 +01:00
iio_utils.h iio: tools: generic_buffer: increase trigger length 2017-05-07 16:08:04 +01:00
lsiio.c tools: iio: lsiio: enumerate processed channels 2016-08-15 18:33:23 +01:00