net: hns3: add a check for queue_id in hclge_reset_vf_queue()
authorYufeng Mo <moyufeng@huawei.com>
Tue, 9 Feb 2021 09:03:05 +0000 (17:03 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Feb 2021 09:35:17 +0000 (10:35 +0100)
commitbeb85f4927e85d4babe24d492aa4327b283f74ae
tree215b5703535ac5f7cb25b68ade33f1e8bd1a3216
parenta045956a3b41ae27814f3855259ed2dcc5b3348f
net: hns3: add a check for queue_id in hclge_reset_vf_queue()

[ Upstream commit 67a69f84cab60484f02eb8cbc7a76edffbb28a25 ]

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

Fixes: 1a426f8b40fc ("net: hns3: fix the VF queue reset flow error")
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c