linux/drivers/scsi/libsas
Dan Carpenter fda8f74d39 scsi: libsas: Use _safe() loop in sas_resume_port()
[ Upstream commit 8c7e7b8486cda21269d393245883c5e4737d5ee7 ]

If sas_notify_lldd_dev_found() fails then this code calls:

	sas_unregister_dev(port, dev);

which removes "dev", our list iterator, from the list.  This could lead to
an endless loop.  We need to use list_for_each_entry_safe().

Link: https://lore.kernel.org/r/YKUeq6gwfGcvvhty@mwanda
Fixes: 303694eeee ("[SCSI] libsas: suspend / resume support")
Reviewed-by: John Garry <john.garry@huawei.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-06-03 08:59:15 +02:00
..
Kconfig treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 167 2019-05-30 11:26:39 -07:00
Makefile treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 167 2019-05-30 11:26:39 -07:00
sas_ata.c scsi: libsas: Reset num_scatter if libata marks qc as NODATA 2021-04-21 12:56:16 +02:00
sas_discover.c scsi: libsas: Fix error path in sas_notify_lldd_dev_found() 2020-09-23 12:40:40 +02:00
sas_event.c scsi: libsas: switch remaining files to SPDX tags 2019-05-21 06:16:22 -04:00
sas_expander.c SCSI misc on 20190709 2019-07-11 15:14:01 -07:00
sas_host_smp.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 372 2019-06-05 17:37:10 +02:00
sas_init.c SCSI misc on 20190709 2019-07-11 15:14:01 -07:00
sas_internal.h SCSI misc on 20190709 2019-07-11 15:14:01 -07:00
sas_phy.c SCSI misc on 20190709 2019-07-11 15:14:01 -07:00
sas_port.c scsi: libsas: Use _safe() loop in sas_resume_port() 2021-06-03 08:59:15 +02:00
sas_scsi_host.c SCSI fixes on 20190720 2019-07-20 10:04:58 -07:00
sas_task.c scsi: libsas: add a SPDX tag to sas_task.c 2019-05-21 06:16:22 -04:00