commit b119d3bc upstream.
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
Signed-off-by: Martin Kelly <email@example.com>
Reported-by: Dan Carpenter <firstname.lastname@example.org>
Fixes: 55dda0ab ("tools: iio: iio_generic_buffer: allow continuous looping")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <email@example.com>