Commit c62ceef8 authored by wenglianfa's avatar wenglianfa Committed by Zihao Xue
Browse files

RDMA/hns: fix error return in hns_roce_v2_modify_srq()

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I9FAYN



------------------------------------

When none of the conditions of the 'if' block are met, 0 should
be returned instead of -EOPNOTSUPP.

Fixes: 5e7ecc38 ("RDMA/hns: Support SW stats with debugfs")
Signed-off-by: default avatarwenglianfa <wenglianfa@huawei.com>
Signed-off-by: default avatarZihao Xue <xuezihao@huawei.com>
parent 03571c27
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -6346,11 +6346,13 @@ static int hns_roce_v2_modify_srq(struct ib_srq *ibsrq,
	struct hns_roce_srq_context *srq_context;
	struct hns_roce_srq_context *srqc_mask;
	struct hns_roce_cmd_mailbox *mailbox;
	int ret = -EOPNOTSUPP;
	int ret = 0;

	/* Resizing SRQs is not supported yet */
	if (srq_attr_mask & IB_SRQ_MAX_WR)
	if (srq_attr_mask & IB_SRQ_MAX_WR) {
		ret = -EOPNOTSUPP;
		goto out;
	}

	if (srq_attr_mask & IB_SRQ_LIMIT) {
		if (srq_attr->srq_limit > srq->wqe_cnt) {