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 10:02:27 +0000 (11:02 +0100)
commit40389ba14d0ee1f7f838e7ba9ba1434eae2aa5df
treef6a4092192806a448130446409a64252bed22b7c
parent6bbc1d5ee0eb52587d794587af7a7aae126a01eb
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