From: Mike Christie michael.christie@oracle.com
[ 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 lduncan@suse.com Signed-off-by: Mike Christie michael.christie@oracle.com Signed-off-by: Martin K. Petersen martin.petersen@oracle.com [Shivani: Modified to apply on 5.10.y] Signed-off-by: Shivani Agarwal shivani.agarwal@broadcom.com --- drivers/scsi/libiscsi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index bad5730bf7ab..59da5cc280a4 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);