Commit c435f0a9 authored by Mike Christie's avatar Mike Christie Committed by Martin K. Petersen

scsi: libiscsi: Fix iSCSI host workq destruction

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().

Link: https://lore.kernel.org/r/20210207044608.27585-5-michael.christie@oracle.comReviewed-by: default avatarLee Duncan <lduncan@suse.com>
Signed-off-by: default avatarMike Christie <michael.christie@oracle.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 14936b1e
...@@ -2738,8 +2738,6 @@ void iscsi_host_remove(struct Scsi_Host *shost) ...@@ -2738,8 +2738,6 @@ void iscsi_host_remove(struct Scsi_Host *shost)
flush_signals(current); flush_signals(current);
scsi_remove_host(shost); scsi_remove_host(shost);
if (ihost->workq)
destroy_workqueue(ihost->workq);
} }
EXPORT_SYMBOL_GPL(iscsi_host_remove); EXPORT_SYMBOL_GPL(iscsi_host_remove);
...@@ -2747,6 +2745,9 @@ void iscsi_host_free(struct Scsi_Host *shost) ...@@ -2747,6 +2745,9 @@ void iscsi_host_free(struct Scsi_Host *shost)
{ {
struct iscsi_host *ihost = shost_priv(shost); struct iscsi_host *ihost = shost_priv(shost);
if (ihost->workq)
destroy_workqueue(ihost->workq);
kfree(ihost->netdev); kfree(ihost->netdev);
kfree(ihost->hwaddress); kfree(ihost->hwaddress);
kfree(ihost->initiatorname); kfree(ihost->initiatorname);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment