]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
IB/ipoib: Prevent setting negative values to max_nonsrq_conn_qp
authorAlex Vesker <valex@mellanox.com>
Thu, 13 Jul 2017 08:27:12 +0000 (11:27 +0300)
committerLeon Romanovsky <leon@kernel.org>
Sun, 23 Jul 2017 06:45:11 +0000 (09:45 +0300)
Don't allow negative values to max_nonsrq_conn_qp. There is no functional
impact on a negative value but it is logicically incorrect.

Fixes: 68e995a29572 ("IPoIB/cm: Add connected mode support for devices without SRQs")
Signed-off-by: Alex Vesker <valex@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/ulp/ipoib/ipoib_main.c

index 144187b407bd54c7b3750a6bce96df28518372e0..8b7ec15a9d6e40208f222d508b03bdc4e1bed5e0 100644 (file)
@@ -2366,6 +2366,7 @@ static int __init ipoib_init_module(void)
        ipoib_sendq_size = max3(ipoib_sendq_size, 2 * MAX_SEND_CQE, IPOIB_MIN_QUEUE_SIZE);
 #ifdef CONFIG_INFINIBAND_IPOIB_CM
        ipoib_max_conn_qp = min(ipoib_max_conn_qp, IPOIB_CM_MAX_CONN_QP);
+       ipoib_max_conn_qp = max(ipoib_max_conn_qp, 0);
 #endif
 
        /*