From: Jie Hai <haijie1@huawei.com>
To: <dev@dpdk.org>, <thomas@monjalon.net>, <ferruh.yigit@amd.com>,
Yisen Zhuang <yisen.zhuang@huawei.com>,
"Min Hu (Connor)" <humin29@huawei.com>,
Hongbo Zheng <zhenghongbo3@huawei.com>
Cc: <lihuisong@huawei.com>, <fengchengwen@huawei.com>, <haijie1@huawei.com>
Subject: [RESEND] net/hns3: verify reset type from firmware
Date: Sat, 12 Oct 2024 17:14:57 +0800 [thread overview]
Message-ID: <20241012091457.21554-1-haijie1@huawei.com> (raw)
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
next reply other threads:[~2024-10-12 9:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-12 9:14 Jie Hai [this message]
2024-10-13 1:00 ` Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241012091457.21554-1-haijie1@huawei.com \
--to=haijie1@huawei.com \
--cc=dev@dpdk.org \
--cc=fengchengwen@huawei.com \
--cc=ferruh.yigit@amd.com \
--cc=humin29@huawei.com \
--cc=lihuisong@huawei.com \
--cc=thomas@monjalon.net \
--cc=yisen.zhuang@huawei.com \
--cc=zhenghongbo3@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).