Re: [PATCH v11 11/12] iio: multiplexer: fix unsigned check with less than zero

2017-03-27 Thread Johan Hovold
On Mon, Mar 27, 2017 at 03:46:47PM +0200, Peter Rosin wrote: > On 2017-03-27 15:06, Johan Hovold wrote: > > On Mon, Mar 27, 2017 at 02:17:48PM +0200, Peter Rosin wrote: > >> Comparing a size_t with less than zero is always false as size_t > >> is unsigned. So, change the type of the variable to ssi

Re: [PATCH v11 11/12] iio: multiplexer: fix unsigned check with less than zero

2017-03-27 Thread Greg Kroah-Hartman
On Mon, Mar 27, 2017 at 03:46:47PM +0200, Peter Rosin wrote: > On 2017-03-27 15:06, Johan Hovold wrote: > > On Mon, Mar 27, 2017 at 02:17:48PM +0200, Peter Rosin wrote: > >> Comparing a size_t with less than zero is always false as size_t > >> is unsigned. So, change the type of the variable to ssi

Re: [PATCH v11 11/12] iio: multiplexer: fix unsigned check with less than zero

2017-03-27 Thread Peter Rosin
On 2017-03-27 15:06, Johan Hovold wrote: > On Mon, Mar 27, 2017 at 02:17:48PM +0200, Peter Rosin wrote: >> Comparing a size_t with less than zero is always false as size_t >> is unsigned. So, change the type of the variable to ssize_t and >> replicate the size check from mux_configure_channel() int

Re: [PATCH v11 11/12] iio: multiplexer: fix unsigned check with less than zero

2017-03-27 Thread Johan Hovold
On Mon, Mar 27, 2017 at 02:17:48PM +0200, Peter Rosin wrote: > Comparing a size_t with less than zero is always false as size_t > is unsigned. So, change the type of the variable to ssize_t and > replicate the size check from mux_configure_channel() into > mux_write_ext_info() thus ensuring that th

[PATCH v11 11/12] iio: multiplexer: fix unsigned check with less than zero

2017-03-27 Thread Peter Rosin
Comparing a size_t with less than zero is always false as size_t is unsigned. So, change the type of the variable to ssize_t and replicate the size check from mux_configure_channel() into mux_write_ext_info() thus ensuring that the size will fit in the ssize_t variable. Detected by CoverityScan, C