mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-05-24 10:39:52 +00:00
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: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
This commit is contained in:
parent
0cf89dcdbc
commit
af04662b4d
1 changed files with 1 additions and 1 deletions
|
@ -319,7 +319,7 @@ int ehca_query_gid(struct ib_device *ibdev, u8 port,
|
||||||
ib_device);
|
ib_device);
|
||||||
struct hipz_query_port *rblock;
|
struct hipz_query_port *rblock;
|
||||||
|
|
||||||
if (index > 255) {
|
if (index < 0 || index > 255) {
|
||||||
ehca_err(&shca->ib_device, "Invalid index: %x.", index);
|
ehca_err(&shca->ib_device, "Invalid index: %x.", index);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue