Skip to content
Snippets Groups Projects
Commit 7058e08c authored by Dan Carpenter's avatar Dan Carpenter Committed by Yang Yingliang
Browse files

scsi: libsas: Use _safe() loop in sas_resume_port()

stable inclusion
from linux-4.19.193
commit 94e2701600ecc5505d4727d580c83b66ecc80ec7

--------------------------------

[ 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: 303694ee ("[SCSI] libsas: suspend / resume support")
Reviewed-by: default avatarJohn Garry <john.garry@huawei.com>
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 1f1faf21
No related branches found
No related tags found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment