Skip to content

Commit

Permalink
IB/ehca: Ensure that guid_entry index is not negative
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Roel Kluin authored and Roland Dreier committed Jun 23, 2009
1 parent 0cf89dc commit af04662
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/ehca/ehca_hca.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit af04662

Please sign in to comment.