Skip to content

Commit 4079c7f

Browse files
solbjorndavem330
authored andcommitted
net: qede: stop adding events on an already destroyed workqueue
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: cee9fbd ("qede: Add qedr framework") Signed-off-by: Alexander Lobakin <[email protected]> Signed-off-by: Igor Russkikh <[email protected]> Signed-off-by: Michal Kalderon <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 31333c1 commit 4079c7f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/qlogic/qede/qede_rdma.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ static void qede_rdma_destroy_wq(struct qede_dev *edev)
105105

106106
qede_rdma_cleanup_event(edev);
107107
destroy_workqueue(edev->rdma_info.rdma_wq);
108+
edev->rdma_info.rdma_wq = NULL;
108109
}
109110

110111
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,
325326
if (edev->rdma_info.exp_recovery)
326327
return;
327328

328-
if (!edev->rdma_info.qedr_dev)
329+
if (!edev->rdma_info.qedr_dev || !edev->rdma_info.rdma_wq)
329330
return;
330331

331332
/* We don't want the cleanup flow to start while we're allocating and

0 commit comments

Comments
 (0)