net: hns3: fix for dereferencing before null checking
authorYunsheng Lin <linyunsheng@huawei.com>
Thu, 13 Jun 2019 09:12:29 +0000 (17:12 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 15 Jun 2019 02:26:16 +0000 (19:26 -0700)
commit757188005f905664b0186b88cf26a7e844190a63
tree98b4f62a2783b2496d0a9224e238a193c58d340f
parentd547ecdc1fc1eb5e9caf678d2f1c02cf3d77cbe7
net: hns3: fix for dereferencing before null checking

The netdev is dereferenced before null checking in the function
hns3_setup_tc.

This patch moves the dereferencing after the null checking.

Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c