Skip to content

Commit 192f97f

Browse files
LiHuiSong1joyxu
authored andcommitted
soc: hisilicon: kunpeng_hccs: Add the check for obtaining complete port attribute
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]>
1 parent 4cece76 commit 192f97f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/soc/hisilicon/kunpeng_hccs.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,12 @@ static int hccs_get_all_port_attr(struct hccs_dev *hdev,
556556
start_id = rsp_head.next_id;
557557
}
558558

559+
if (left_buf_len != 0) {
560+
dev_err(hdev->dev, "failed to get the expected port number(%u) attribute.\n",
561+
size);
562+
return -EINVAL;
563+
}
564+
559565
return 0;
560566
}
561567

0 commit comments

Comments
 (0)