Commit 0dc02967 authored by Juan Zhou's avatar Juan Zhou
Browse files

RDMA/hns: Fix incorrect variable usage in scc_attr_is_visible()

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



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

The supported algorithm capabilities should be checked,
instead of the default algorithm type.

Fixes: 41da9cd8 ("RDMA/hns: Support congestion control algorithm parameter configuration")
Signed-off-by: default avatarJuan Zhou <zhoujuan51@h-partners.com>
parent 386f263a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -178,7 +178,7 @@ static umode_t scc_attr_is_visible(struct kobject *kobj,
	    !(hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_QP_FLOW_CTRL))
		return 0;

	if (!(hr_dev->caps.default_cong_type & (1 << scc_attr->algo_type)))
	if (!(hr_dev->caps.cong_cap & (1 << scc_attr->algo_type)))
		return 0;

	return 0644;