提交 23c15c21 编写于 作者: R Roland Dreier

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: NRoland Dreier <rolandd@cisco.com>
上级 65adfa91
......@@ -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]);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册