net: hns3: void array out of bound when loop tnl_num
authorPeiyang Wang <wangpeiyang1@huawei.com>
Tue, 13 Aug 2024 14:10:23 +0000 (22:10 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 15 Aug 2024 11:07:08 +0000 (13:07 +0200)
commit86db7bfb06704ef17340eeae71c832f21cfce35c
treeacc36b149a04ab6aa75c6aa313a291fbdcfe8153
parentbe5e816d00a506719e9dbb1a9c861c5ced30a109
net: hns3: void array out of bound when loop tnl_num

When query reg inf of SSU, it loops tnl_num times. However, tnl_num comes
from hardware and the length of array is a fixed value. To void array out
of bound, make sure the loop time is not greater than the length of array

Signed-off-by: Peiyang Wang <wangpeiyang1@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c