]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2019 07:12:35 +0000 (09:12 +0200)
commit2da60b8e383d8ecef277d17d9796455c09b98ebe
tree07d7a471a87da708e14d66adaa585c883c58b036
parent38d13b389d5b0757e062fcd98fdd6a166354c2c7
net: hns3: fix for dereferencing before null checking

[ Upstream commit 757188005f905664b0186b88cf26a7e844190a63 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c