]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RDMA/hns: Fix invalid sq params not being blocked
authorJunxian Huang <huangjunxian6@hisilicon.com>
Tue, 11 Mar 2025 08:48:54 +0000 (16:48 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Mar 2025 21:03:26 +0000 (22:03 +0100)
commit7912097c930477bffcef0182791ba13e7dde65a4
treea05bc9d2b40e5b84e22cf42e6c48920328785cdf
parent4e4c2571aac49388976b78e2459ffbc05239cb68
RDMA/hns: Fix invalid sq params not being blocked

[ Upstream commit 13c90c222049764bb7e6a1689bd785f424bd8bd5 ]

SQ params from userspace are checked in by set_user_sq_size(). But
when the check fails, the function doesn't return but instead keep
running and overwrite 'ret'. As a result, the invalid params will
not get blocked actually.

Add a return right after the failed check. Besides, although the
check result of kernel sq params will not be overwritten, to keep
coding style unified, move default_congest_type() before
set_kernel_sq_size().

Fixes: 6ec429d5887a ("RDMA/hns: Support userspace configuring congestion control algorithm with QP granularity")
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://patch.msgid.link/20250311084857.3803665-5-huangjunxian6@hisilicon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/hns/hns_roce_qp.c