Commit b55dede8 authored by Huisong Li's avatar Huisong Li Committed by huangdengdui
Browse files

soc: hisilicon: kunpeng_hccs: Add the check for obtaining complete port attribute

mainline inclusion
from mainline-v6.9-rc1
commit 192f97fe164dd946d0da54bf6e17ff6f9ab9ba43
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I9UY3Z
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=192f97fe164dd946d0da54bf6e17ff6f9ab9ba43



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

The hccs_get_all_port_attr() is used to obtain the attribute of all the
ports on a specified DIE from the firmware. However this interface doesn't
ensure whether the firmware reports the complete attribute of all the ports
or not. So this patch adds the check for this.

Signed-off-by: default avatarHuisong Li <lihuisong@huawei.com>
Signed-off-by: default avatarWei Xu <xuwei5@hisilicon.com>
parent ad54b708
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -556,6 +556,12 @@ static int hccs_get_all_port_attr(struct hccs_dev *hdev,
		start_id = rsp_head.next_id;
	}

	if (left_buf_len != 0) {
		dev_err(hdev->dev, "failed to get the expected port number(%u) attribute.\n",
			size);
		return -EINVAL;
	}

	return 0;
}