diff mbox series

[v3,07/17] scsi: iscsi: move pool freeing

Message ID 20210416020440.259271-8-michael.christie@oracle.com
State Superseded
Headers show
Series libicsi and qedi TMF fixes | expand

Commit Message

Mike Christie April 16, 2021, 2:04 a.m. UTC
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.

Signed-off-by: Mike Christie <michael.christie@oracle.com>
---
 drivers/scsi/libiscsi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Lee Duncan April 24, 2021, 9:12 p.m. UTC | #1
On 4/15/21 7:04 PM, Mike Christie wrote:
> 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.

> 

> Signed-off-by: Mike Christie <michael.christie@oracle.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 56b41d8fff02..b2970054558a 100644

> --- a/drivers/scsi/libiscsi.c

> +++ b/drivers/scsi/libiscsi.c

> @@ -3025,10 +3025,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);

> 


Reviewed-by: Lee Duncan <lduncan@suse.com>
diff mbox series

Patch

diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 56b41d8fff02..b2970054558a 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -3025,10 +3025,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);