From: Greg Kroah-Hartman Date: Thu, 19 Sep 2019 09:05:48 +0000 (+0200) Subject: 5.2-stable patches X-Git-Tag: v4.4.194~56 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=767b360836da9907f9e025c775238f0dfdb76fd5;p=thirdparty%2Fkernel%2Fstable-queue.git 5.2-stable patches added patches: net-hns3-adjust-hns3_uninit_phy-s-location-in-the-hns3_client_uninit.patch --- diff --git a/queue-5.2/net-hns3-adjust-hns3_uninit_phy-s-location-in-the-hns3_client_uninit.patch b/queue-5.2/net-hns3-adjust-hns3_uninit_phy-s-location-in-the-hns3_client_uninit.patch new file mode 100644 index 00000000000..5f10cd0546f --- /dev/null +++ b/queue-5.2/net-hns3-adjust-hns3_uninit_phy-s-location-in-the-hns3_client_uninit.patch @@ -0,0 +1,43 @@ +From 0d2f68c7bcf4c7bbdd6f810f7b6e658f43d4461e Mon Sep 17 00:00:00 2001 +From: Huazhong Tan +Date: Tue, 28 May 2019 17:03:01 +0800 +Subject: net: hns3: adjust hns3_uninit_phy()'s location in the hns3_client_uninit() + +From: Huazhong Tan + +commit 0d2f68c7bcf4c7bbdd6f810f7b6e658f43d4461e upstream. + +hns3_uninit_phy() should be called before checking +HNS3_NIC_STATE_INITED flags, otherwise when this checking fails, +there is nobody to call hns3_uninit_phy(). + +Fixes: c8a8045b2d0a ("net: hns3: Fix NULL deref when unloading driver") +Signed-off-by: Huazhong Tan +Signed-off-by: Peng Li +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c ++++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +@@ -3896,6 +3896,8 @@ static void hns3_client_uninit(struct hn + + hns3_client_stop(handle); + ++ hns3_uninit_phy(netdev); ++ + if (!test_and_clear_bit(HNS3_NIC_STATE_INITED, &priv->state)) { + netdev_warn(netdev, "already uninitialized\n"); + goto out_netdev_free; +@@ -3905,8 +3907,6 @@ static void hns3_client_uninit(struct hn + + hns3_clear_all_ring(handle, true); + +- hns3_uninit_phy(netdev); +- + hns3_nic_uninit_vector_data(priv); + + ret = hns3_nic_dealloc_vector_data(priv); diff --git a/queue-5.2/series b/queue-5.2/series new file mode 100644 index 00000000000..2846b9e9962 --- /dev/null +++ b/queue-5.2/series @@ -0,0 +1 @@ +net-hns3-adjust-hns3_uninit_phy-s-location-in-the-hns3_client_uninit.patch