diff options
| author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2016-08-24 07:06:58 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-31 15:42:28 +0200 |
| commit | 0b1221a36ca53dca5992caf6b37f67c98bb4e431 (patch) | |
| tree | c597b95d5105ed5e164504842a2ceac6aecde581 /tools/perf/scripts/python/bin/export-to-postgresql-report | |
| parent | 761ed4a94582ab291aa24dcbea4e01e8936488c8 (diff) | |
| download | linux-0b1221a36ca53dca5992caf6b37f67c98bb4e431.tar.gz linux-0b1221a36ca53dca5992caf6b37f67c98bb4e431.zip | |
serial: vt8500_serial: Fix a parameter of find_first_zero_bit.
The 2nd parameter of 'find_first_zero_bit' is the number of bits to search.
In this case, we are passing 'sizeof(vt8500_ports_in_use)'.
'vt8500_ports_in_use' is an 'unsigned long'. So the sizeof is likely to
return 4 on a 32 bits kernel.
A few lines below, we check if it is below VT8500_MAX_PORTS, which is 6.
It is likely that the number of bits in a long was expected here.
In order to fix it:
- use DECLARE_BITMAP when declaring the vt8500_ports_in_use
- use VT8500_MAX_PORTS as a maximum value when checking/setting bits in
this bitmap
- modify code now that 'vt8500_ports_in_use' has become a pointer
because of the use of DECLARE_BITMAP
It has been spotted by the following coccinelle script:
@@
expression ret, x;
@@
* ret = \(find_first_bit \| find_first_zero_bit\) (x, sizeof(...));
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python/bin/export-to-postgresql-report')
0 files changed, 0 insertions, 0 deletions
