]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: qede: stop adding events on an already destroyed workqueue
authorAlexander Lobakin <alobakin@marvell.com>
Tue, 23 Jun 2020 13:51:31 +0000 (16:51 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 23 Jun 2020 22:01:16 +0000 (15:01 -0700)
Set rdma_wq pointer to NULL after destroying the workqueue and check
for it when adding new events to fix crashes on driver unload.

Fixes: cee9fbd8e2e9 ("qede: Add qedr framework")
Signed-off-by: Alexander Lobakin <alobakin@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: Michal Kalderon <michal.kalderon@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qede/qede_rdma.c

index 2d873ae8a234d2520a79febe99d740e3e4b95913..668ccc9d49f839d2119225b3041402962caaba3a 100644 (file)
@@ -105,6 +105,7 @@ static void qede_rdma_destroy_wq(struct qede_dev *edev)
 
        qede_rdma_cleanup_event(edev);
        destroy_workqueue(edev->rdma_info.rdma_wq);
+       edev->rdma_info.rdma_wq = NULL;
 }
 
 int qede_rdma_dev_add(struct qede_dev *edev, bool recovery)
@@ -325,7 +326,7 @@ static void qede_rdma_add_event(struct qede_dev *edev,
        if (edev->rdma_info.exp_recovery)
                return;
 
-       if (!edev->rdma_info.qedr_dev)
+       if (!edev->rdma_info.qedr_dev || !edev->rdma_info.rdma_wq)
                return;
 
        /* We don't want the cleanup flow to start while we're allocating and