kernel_optimize_test/drivers/usb/wusbcore
Julia Lawall d3ac5598c5 usb: wusbcore: security: cast sizeof to int for comparison
Comparing an int to a size, which is unsigned, causes the int to become
unsigned, giving the wrong result.  usb_get_descriptor can return a
negative error code.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
int x;
expression e,e1;
identifier f;
@@

*x = f(...);
... when != x = e1
    when != if (x < 0 || ...) { ... return ...; }
*x < sizeof(e)
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-02 18:08:19 +02:00
..
cbaf.c
crypto.c
dev-sysfs.c
devconnect.c
Kconfig
Makefile
mmc.c
pal.c
reservation.c
rh.c
security.c usb: wusbcore: security: cast sizeof to int for comparison 2018-07-02 18:08:19 +02:00
wa-hc.c
wa-hc.h
wa-nep.c
wa-rpipe.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
wa-xfer.c usb: wusbcore: remove excessive irqsave 2018-06-28 19:36:06 +09:00
wusbhc.c
wusbhc.h