scsi: osst: drop SCSI devie reference taken before

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In the function __os_scsi_tape_open, scsi_device_get is called to take a
reference of the device. The reference should be dropped when it is no
longer used. However, when scsi_block_when_processing_errors returns a
false value, the reference is not dropped. This patch fixes the bug.

Signed-off-by: Pan Bian <bianpan2016@xxxxxxx>
---
 drivers/scsi/osst.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
index be3c73e..f2b2b86 100644
--- a/drivers/scsi/osst.c
+++ b/drivers/scsi/osst.c
@@ -4489,7 +4489,8 @@ static int __os_scsi_tape_open(struct inode * inode, struct file * filp)
 	STp->rew_at_close = TAPE_REWIND(inode);
 
 	if( !scsi_block_when_processing_errors(STp->device) ) {
-		return -ENXIO;
+		retval = -ENXIO;
+		goto err_out;
 	}
 
 	if (mode != STp->current_mode) {
-- 
2.7.4





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux