]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: hns3: set ops to null when unregister ad_dev
authorWeihang Li <liweihang@hisilicon.com>
Mon, 3 Jun 2019 02:09:18 +0000 (10:09 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2019 07:12:29 +0000 (09:12 +0200)
commit28a7d7a6dcd70c405c8added34a60a1049bb25cd
treef6790ed679eb2796ef08151a33b0b792848beae9
parentbd87e2a197f6958c8b613cee022d50ec7c9fca83
net: hns3: set ops to null when unregister ad_dev

[ Upstream commit 594a81b39525f0a17e92c2e0b167ae1400650380 ]

The hclge/hclgevf and hns3 module can be unloaded independently,
when hclge/hclgevf unloaded firstly, the ops of ae_dev should
be set to NULL, otherwise it will cause an use-after-free problem.

Fixes: 38caee9d3ee8 ("net: hns3: Add support of the HNAE3 framework")
Signed-off-by: Weihang Li <liweihang@hisilicon.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/hnae3.c