]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: add a check for tqp_index in hclge_get_ring_chain_from_mbx()
authorYufeng Mo <moyufeng@huawei.com>
Tue, 9 Feb 2021 09:03:06 +0000 (17:03 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 9 Feb 2021 23:20:43 +0000 (15:20 -0800)
commite657780883d9c3d24b8be65c4d01cb4410aa35b6
tree696ae6870a96d1d1edb32ac240e227ed498157e9
parent5ad8d8ee4bc3140fe416f245d4169ffe38320b3a
net: hns3: add a check for tqp_index in hclge_get_ring_chain_from_mbx()

The tqp_index is received from vf, if use it directly,
an out-of-bound issue may be caused, so add a check for
this tqp_index before using it in hclge_get_ring_chain_from_mbx().

Fixes: 2f0e608f81d3 ("net: hns3: Change PF to add ring-vect binding & resetQ to mailbox")
Signed-off-by: Yufeng Mo <moyufeng@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_mbx.c