net: hns3: fix vf id check issue when add flow director rule
authorJian Shen <shenjian15@huawei.com>
Thu, 20 Dec 2018 03:52:03 +0000 (11:52 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Dec 2018 07:47:58 +0000 (23:47 -0800)
commit0285dbae5db842862d49f148cdcedad986447f34
tree693ad16258fac2c33abb9e24daff1e43f0400248
parent39cfbc9c4fc4a2888548c2624789e42e3f775721
net: hns3: fix vf id check issue when add flow director rule

When add flow director fule for vf, the vf id is used as array
subscript before valid checking, which may cause memory overflow.

Fixes: dd74f815dd41 ("net: hns3: Add support for rule add/delete for flow director")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c