Skip to content

Commit 23ec323

Browse files
mikechristienathan-zcgao
authored andcommitted
scsi: iscsi: Move pool freeing
commit a1f3486 upstream. This doesn't fix any bugs, but it makes more sense to free the pool after we have removed the session. At that time we know nothing is touching any of the session fields, because all devices have been removed and scans are stopped. Link: https://lore.kernel.org/r/20210525181821.7617-19-michael.christie@oracle.com Reviewed-by: Lee Duncan <lduncan@suse.com> Signed-off-by: Mike Christie <michael.christie@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Nathan Gao <zcgao@amazon.com>
1 parent 3cb1455 commit 23ec323

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/scsi/libiscsi.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2846,10 +2846,9 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session)
28462846
struct module *owner = cls_session->transport->owner;
28472847
struct Scsi_Host *shost = session->host;
28482848

2849-
iscsi_pool_free(&session->cmdpool);
2850-
28512849
iscsi_remove_session(cls_session);
28522850

2851+
iscsi_pool_free(&session->cmdpool);
28532852
kfree(session->password);
28542853
kfree(session->password_in);
28552854
kfree(session->username);

0 commit comments

Comments
 (0)