Skip to content

Commit

Permalink
net/hns3: verify reset type from firmware
Browse files Browse the repository at this point in the history
Verify reset-type which get from firmware.

Fixes: 1c1eb75 ("net/hns3: support RAS process in Kunpeng 930")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Jie Hai <haijie1@huawei.com>
  • Loading branch information
fengchengwen authored and ferruhy committed Oct 13, 2024
1 parent abac260 commit d3a4337
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/hns3/hns3_intr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2252,6 +2252,12 @@ hns3_handle_module_error_data(struct hns3_hw *hw, uint32_t *buf,
sum_err_info = (struct hns3_sum_err_info *)&buf[offset++];
mod_num = sum_err_info->mod_num;
reset_type = sum_err_info->reset_type;

if (reset_type >= HNS3_MAX_RESET) {
hns3_err(hw, "invalid reset type = %u", reset_type);
return;
}

if (reset_type && reset_type != HNS3_NONE_RESET)
hns3_atomic_set_bit(reset_type, &hw->reset.request);

Expand Down

0 comments on commit d3a4337

Please sign in to comment.