mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2025-04-19 20:58:31 +09:00
scsi: core: Fix missing lock protection
async_scan_lock is designed to protect the scanning_hosts list, but there is no protection here. Signed-off-by: Chaohai Chen <wdhh66@163.com> Link: https://lore.kernel.org/r/20250221030755.219277-1-wdhh66@163.com Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
ac0fb4a55b
commit
ed3e484222
@ -151,8 +151,9 @@ int scsi_complete_async_scans(void)
|
||||
struct async_scan_data *data;
|
||||
|
||||
do {
|
||||
if (list_empty(&scanning_hosts))
|
||||
return 0;
|
||||
scoped_guard(spinlock, &async_scan_lock)
|
||||
if (list_empty(&scanning_hosts))
|
||||
return 0;
|
||||
/* If we can't get memory immediately, that's OK. Just
|
||||
* sleep a little. Even if we never get memory, the async
|
||||
* scans will finish eventually.
|
||||
|
Loading…
x
Reference in New Issue
Block a user