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: stable@vger.kernel.org Signed-off-by: Yihang Li <liyihang9@h-partners.com> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Signed-off-by: Niklas Cassel <cassel@kernel.org>
1 parent 12d724f commit b32cc17

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

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)