From: Mike Christie Date: Thu, 8 Jan 2026 06:22:21 +0000 (-0800) Subject: scsi: iscsi: Move pool freeing X-Git-Tag: v5.10.248~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1bbc51778f574146a11eb4aae832b067b3af583d;p=thirdparty%2Fkernel%2Fstable.git scsi: iscsi: Move pool freeing [ Upstream commit a1f3486b3b095ed2259d7a1fc021a8b6e72a5365 ] 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 Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen [Shivani: Modified to apply on 5.10.y] Signed-off-by: Shivani Agarwal Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index bad5730bf7ab3..59da5cc280a44 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c @@ -2902,10 +2902,9 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session) struct module *owner = cls_session->transport->owner; struct Scsi_Host *shost = session->host; - iscsi_pool_free(&session->cmdpool); - iscsi_remove_session(cls_session); + iscsi_pool_free(&session->cmdpool); kfree(session->password); kfree(session->password_in); kfree(session->username);