Skip to content

Commit b32cc17

Browse files
Yihang Lifloatious
authored andcommitted
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: 0c76106 ("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]>
1 parent 12d724f commit b32cc17

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/ata/libata-scsi.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4894,8 +4894,10 @@ void ata_scsi_dev_rescan(struct work_struct *work)
48944894
spin_unlock_irqrestore(ap->lock, flags);
48954895
if (do_resume) {
48964896
ret = scsi_resume_device(sdev);
4897-
if (ret == -EWOULDBLOCK)
4897+
if (ret == -EWOULDBLOCK) {
4898+
scsi_device_put(sdev);
48984899
goto unlock_scan;
4900+
}
48994901
dev->flags &= ~ATA_DFLAG_RESUMING;
49004902
}
49014903
ret = scsi_rescan_device(sdev);

0 commit comments

Comments
 (0)