Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af04662b authored by Roel Kluin's avatar Roel Kluin Committed by Roland Dreier
Browse files

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: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 0cf89dcd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
	}