* [RESEND] net/hns3: verify reset type from firmware
@ 2024-10-12 9:14 Jie Hai
2024-10-13 1:00 ` Ferruh Yigit
0 siblings, 1 reply; 2+ messages in thread
From: Jie Hai @ 2024-10-12 9:14 UTC (permalink / raw)
To: dev, thomas, ferruh.yigit, Yisen Zhuang, Min Hu (Connor), Hongbo Zheng
Cc: lihuisong, fengchengwen, haijie1
From: Chengwen Feng <fengchengwen@huawei.com>
Verify reset-type which get from firmware.
Fixes: 1c1eb759e9d7 ("net/hns3: support RAS process in Kunpeng 930")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
drivers/net/hns3/hns3_intr.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/hns3/hns3_intr.c b/drivers/net/hns3/hns3_intr.c
index f7162ee7bc5f..2de2b86b0297 100644
--- a/drivers/net/hns3/hns3_intr.c
+++ b/drivers/net/hns3/hns3_intr.c
@@ -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);
--
2.22.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [RESEND] net/hns3: verify reset type from firmware
2024-10-12 9:14 [RESEND] net/hns3: verify reset type from firmware Jie Hai
@ 2024-10-13 1:00 ` Ferruh Yigit
0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2024-10-13 1:00 UTC (permalink / raw)
To: Jie Hai, dev, thomas, Yisen Zhuang, Min Hu (Connor), Hongbo Zheng
Cc: lihuisong, fengchengwen
On 10/12/2024 10:14 AM, Jie Hai wrote:
> From: Chengwen Feng <fengchengwen@huawei.com>
>
> Verify reset-type which get from firmware.
>
> Fixes: 1c1eb759e9d7 ("net/hns3: support RAS process in Kunpeng 930")
> Cc: stable@dpdk.org
>
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
>
Adding implicit ack:
Acked-by: Jie Hai <haijie1@huawei.com>
Applied to dpdk-next-net/main, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-10-13 1:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-12 9:14 [RESEND] net/hns3: verify reset type from firmware Jie Hai
2024-10-13 1:00 ` Ferruh Yigit
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).