]> 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)
commit081169adafbeebbeed53b375d2b81e817c9147c6
tree98b4f62a2783b2496d0a9224e238a193c58d340f
parente92b601bada1674c33460adf7fbf071cb7838deb
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: 6e2406330b28 ("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