Skip to content
Commit 563ca0e9 authored by Dan Carpenter's avatar Dan Carpenter Committed by Leon Romanovsky
Browse files

RDMA/mana_ib: Prevent array underflow in mana_ib_create_qp_raw()



The "port" comes from the user and if it is zero then the:

	ndev = mc->ports[port - 1];

assignment does an out of bounds read.  I have changed the if
statement to fix this and to mirror how it is done in
mana_ib_create_qp_rss().

Fixes: 0266a177 ("RDMA/mana_ib: Add a driver for Microsoft Azure Network Adapter")
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/r/Y8/3Vn8qx00kE9Kk@kili


Acked-by: default avatarLong Li <longli@microsoft.com>
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
parent f9c47b2c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment