Thread (13 messages) 13 messages, 2 authors, 2021-01-28
STALE1988d
Revisions (2)
  1. v1 [diff vs current]
  2. v1 current

[PATCH 4/7] libiscsi: fix iscsi host workq destruction

From: Mike Christie <michael.christie@oracle.com>
Date: 2021-01-18 20:38:21
Subsystem: iscsi, scsi subsystem, the rest · Maintainers: Lee Duncan, Chris Leech, Mike Christie, "James E.J. Bottomley", "Martin K. Petersen", Linus Torvalds

We allocate the iscsi host workq in iscsi_host_alloc so iscsi_host_free
should do the destruction. Drivers can then do their error/goto handling
and call iscsi_host_free to clean up what has been allocated in
iscsi_host_alloc.

Signed-off-by: Mike Christie <michael.christie@oracle.com>
---
 drivers/scsi/libiscsi.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index ec159bcb7460..b271d3accd2a 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -2738,8 +2738,6 @@ void iscsi_host_remove(struct Scsi_Host *shost)
 		flush_signals(current);
 
 	scsi_remove_host(shost);
-	if (ihost->workq)
-		destroy_workqueue(ihost->workq);
 }
 EXPORT_SYMBOL_GPL(iscsi_host_remove);
 
@@ -2747,6 +2745,9 @@ void iscsi_host_free(struct Scsi_Host *shost)
 {
 	struct iscsi_host *ihost = shost_priv(shost);
 
+	if (ihost->workq)
+		destroy_workqueue(ihost->workq);
+
 	kfree(ihost->netdev);
 	kfree(ihost->hwaddress);
 	kfree(ihost->initiatorname);
-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help