mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-20 08:22:39 +00:00
mlx4_core: Fix array overrun in dump_dev_cap_flags()
Don't overrun fname[] array when decoding device flags. This was spotted by the Coverity checker (CID 1642). Signed-off-by: Roland Dreier <rolandd@cisco.com>
This commit is contained in:
parent
65adfa911a
commit
23c15c21d3
@ -90,7 +90,7 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u32 flags)
|
||||
int i;
|
||||
|
||||
mlx4_dbg(dev, "DEV_CAP flags:\n");
|
||||
for (i = 0; i < 32; ++i)
|
||||
for (i = 0; i < ARRAY_SIZE(fname); ++i)
|
||||
if (fname[i] && (flags & (1 << i)))
|
||||
mlx4_dbg(dev, " %s\n", fname[i]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user