提交 af04662b 编写于 作者: R Roel Kluin 提交者: Roland Dreier

IB/ehca: Ensure that guid_entry index is not negative

This prevents the memcpy() of a guid_entries element using a negative index.
Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: NRoland Dreier <rolandd@cisco.com>
上级 0cf89dcd
......@@ -319,7 +319,7 @@ int ehca_query_gid(struct ib_device *ibdev, u8 port,
ib_device);
struct hipz_query_port *rblock;
if (index > 255) {
if (index < 0 || index > 255) {
ehca_err(&shca->ib_device, "Invalid index: %x.", index);
return -EINVAL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册