diff options
| author | Yihang Li <[email protected]> | 2025-11-20 03:50:23 +0000 |
|---|---|---|
| committer | Niklas Cassel <[email protected]> | 2025-11-20 12:12:26 +0000 |
| commit | b32cc17d607e8ae7af037303fe101368cb4dc44c (patch) | |
| tree | 898f4b6b7925c0cd11481e885087fefab1c330e0 | |
| parent | ata: libata-core: relax checks in ata_read_log_directory() (diff) | |
| download | kernel-b32cc17d607e8ae7af037303fe101368cb4dc44c.tar.gz kernel-b32cc17d607e8ae7af037303fe101368cb4dc44c.zip | |
ata: libata-scsi: Add missing scsi_device_put() in ata_scsi_dev_rescan()
Call scsi_device_put() in ata_scsi_dev_rescan() if the device or its
queue are not running.
Fixes: 0c76106cb975 ("scsi: sd: Fix TCG OPAL unlock on system resume")
Cc: [email protected]
Signed-off-by: Yihang Li <[email protected]>
Reviewed-by: Damien Le Moal <[email protected]>
Signed-off-by: Niklas Cassel <[email protected]>
| -rw-r--r-- | drivers/ata/libata-scsi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index b43a3196e2be..3fb84f690644 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -4894,8 +4894,10 @@ void ata_scsi_dev_rescan(struct work_struct *work) spin_unlock_irqrestore(ap->lock, flags); if (do_resume) { ret = scsi_resume_device(sdev); - if (ret == -EWOULDBLOCK) + if (ret == -EWOULDBLOCK) { + scsi_device_put(sdev); goto unlock_scan; + } dev->flags &= ~ATA_DFLAG_RESUMING; } ret = scsi_rescan_device(sdev); |
