If a network failure occurs before any DLM traffic can be
generated, the send and receive workqueues can be NULL
when work_stop() is called.  Check to see if these workqueues
are NULL before calling destroy_workqueue().

Signed-off-by: David Windsor <dwind...@redhat.com>
---
 fs/dlm/lowcomms.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 76976d6e50f9..905cbdbd31bc 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -1630,8 +1630,10 @@ static void clean_writequeues(void)
 
 static void work_stop(void)
 {
-       destroy_workqueue(recv_workqueue);
-       destroy_workqueue(send_workqueue);
+       if (recv_workqueue)
+               destroy_workqueue(recv_workqueue);
+       if (send_workqueue)
+               destroy_workqueue(send_workqueue);
 }
 
 static int work_start(void)
-- 
2.20.1

Reply via email to