]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitc11899d2dd373b26295bb5713dd27b8625468bfe
tree98b4f62a2783b2496d0a9224e238a193c58d340f
parentf3b8928906378728a8626ad3922c12a19c31a077
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: 327a841d1dd9 ("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