]> Git Repo - linux.git/commitdiff
soc: hisilicon: kunpeng_hccs: Add the check for obtaining complete port attribute
authorHuisong Li <[email protected]>
Wed, 17 Apr 2024 09:48:00 +0000 (17:48 +0800)
committerWei Xu <[email protected]>
Thu, 25 Apr 2024 01:30:33 +0000 (01:30 +0000)
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: Huisong Li <[email protected]>
Signed-off-by: Wei Xu <[email protected]>
drivers/soc/hisilicon/kunpeng_hccs.c

index 9ff70b38e5e99cab30efad847a6bb5ffe2374dd1..e882a61636ec860622f3bc0aac84e50b2688114c 100644 (file)
@@ -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;
 }
 
This page took 0.05247 seconds and 4 git commands to generate.