diff options
author | 2018-08-01 15:57:43 -0700 | |
---|---|---|
committer | 2018-08-01 16:05:55 -0700 | |
commit | ce1d6f22fa69287f877aca37e275c776ed6e6eb5 (patch) | |
tree | 57219e88517ae70ccbad12da8268422e09a34c81 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | Input: i8042 - add Lenovo LaVie Z to the i8042 reset list (diff) | |
download | linux-dev-ce1d6f22fa69287f877aca37e275c776ed6e6eb5.tar.xz linux-dev-ce1d6f22fa69287f877aca37e275c776ed6e6eb5.zip |
Input: elan_i2c_smbus - 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. i2c_smbus_read_block_data can return the
result of i2c_smbus_xfer, whih 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: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions