diff options
| author | Julia Lawall <[email protected]> | 2018-07-01 13:32:05 -0400 |
|---|---|---|
| committer | Mauro Carvalho Chehab <[email protected]> | 2018-07-25 08:35:12 -0400 |
| commit | 2e3134caf63694bf1dbb2e68829871e14d543613 (patch) | |
| tree | 55db564e291bf8ef073c902ae49fb2a05f408038 /tools/perf/scripts/python/mem-phys-addr.py | |
| parent | 5a1a2f63d840dc2631505b607e11ff65ac1b7d3c (diff) | |
media: gspca_kinect: 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. kinect_read returns the result of
usb_control_msg, which can return a negtive 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 <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/mem-phys-addr.py')
0 files changed, 0 insertions, 0 deletions