net: hns3: add a check for index in hclge_get_rss_key()
authorYufeng Mo <moyufeng@huawei.com>
Tue, 9 Feb 2021 09:03:07 +0000 (17:03 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 9 Feb 2021 23:20:43 +0000 (15:20 -0800)
commit532cfc0df1e4d68e74522ef4a0dcbf6ebbe68287
tree514fff9bbd472bb30699e30b8e2cd9d08115f1ca
parent326334aad024a60f46dc5e7dbe1efe32da3ca66f
net: hns3: add a check for index in hclge_get_rss_key()

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

Fixes: a638b1d8cc87 ("net: hns3: fix get VF RSS issue")
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