Re: [PATCH] USB: hso: Fix OOB memory access in hso_probe/hso_get_config_data,Re: [PATCH] USB: hso: Fix OOB memory access in hso_probe/hso_get_config_data

From: David Miller <davem@davemloft.net>
Date: 2018-12-09 20:06:21
Also in: linux-usb

From: Mathias Payer <redacted>
Date: Sun, 9 Dec 2018 21:02:25 +0100
Passing an int to the macro results in a compiler warning. One option would be
to test for the individual errors (instead of using the macro) with the drawback
that future extensions that return different errors may be missed. Another
alternative is to test for negative values with the drawback that this bypasses
the existing test macros.
The whole kernel is full of situations where an int is returned and if it's
negative it's an error.  Why is this location so different?

Just check < 0 and be done with it.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help