aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_transport_iscsi.c
diff options
context:
space:
mode:
authorMike Christie <michael.christie@oracle.com>2022-06-16 17:27:33 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2022-06-21 21:14:53 -0400
commitc577ab7ba5f3bf9062db8a58b6e89d4fe370447e (patch)
tree237689dc1ba5552e34b75e8916db37e04c56da78 /drivers/scsi/scsi_transport_iscsi.c
parentscsi: ufs: ufs-mediatek: Fix build error and type mismatch (diff)
downloadlinux-dev-c577ab7ba5f3bf9062db8a58b6e89d4fe370447e.tar.xz
linux-dev-c577ab7ba5f3bf9062db8a58b6e89d4fe370447e.zip
scsi: iscsi: Fix HW conn removal use after free
If qla4xxx doesn't remove the connection before the session, the iSCSI class tries to remove the connection for it. We were doing a iscsi_put_conn() in the iter function which is not needed and will result in a use after free because iscsi_remove_conn() will free the connection. Link: https://lore.kernel.org/r/20220616222738.5722-2-michael.christie@oracle.com Tested-by: Nilesh Javali <njavali@marvell.com> Reviewed-by: Lee Duncan <lduncan@suse.com> Reviewed-by: Nilesh Javali <njavali@marvell.com> Signed-off-by: Mike Christie <michael.christie@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/scsi_transport_iscsi.c')
-rw-r--r--drivers/scsi/scsi_transport_iscsi.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index 360e73ee29d5..888f9f7472f2 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -2138,8 +2138,6 @@ static int iscsi_iter_destroy_conn_fn(struct device *dev, void *data)
return 0;
iscsi_remove_conn(iscsi_dev_to_conn(dev));
- iscsi_put_conn(iscsi_dev_to_conn(dev));
-
return 0;
}