net/sfc/base: fix shift by more bits than field width
This was probably an oversight when support for multiple sensor pages
was added.
Despite being undefined behaviour in C, it probably worked on Intel
x32/x64 as on them bit shift operations wrap round.
Fixes: dfb3b1ce15
("net/sfc/base: import monitors access via MCDI")
Cc: stable@dpdk.org
Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
This commit is contained in:
parent
b69259cd15
commit
1dcd3a9895
@ -73,7 +73,8 @@ mcdi_mon_decode_stats(
|
||||
/* This sensor is one of the page boundary bits. */
|
||||
}
|
||||
|
||||
if (~(sensor_mask[page]) & (1U << sensor))
|
||||
if (~(sensor_mask[page]) &
|
||||
(1U << (sensor % (sizeof (sensor_mask[page]) * 8))))
|
||||
continue;
|
||||
/* This sensor not in DMA buffer */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user