]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: remediate a potential overflow risk of bd_num_list
authorGuangbin Huang <huangguangbin2@huawei.com>
Mon, 29 Mar 2021 03:57:47 +0000 (11:57 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 29 Mar 2021 20:21:00 +0000 (13:21 -0700)
commit9eabf477df5f1f83b75b4d164619c647a1fb60be
tree96358e12108403cd08ced46118d4e1288cf301af
parent2b0b689970d9aea0eb1be6559d1a98fd97c9889f
net: hns3: remediate a potential overflow risk of bd_num_list

The array size of bd_num_list is a fixed value, it may have potential
overflow risk when array size of hclge_dfx_bd_offset_list is greater
than that fixed value. So modify bd_num_list as a pointer and allocate
memory for it according to array size of hclge_dfx_bd_offset_list.

Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c