lkml.org 
[lkml]   [2019]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subjectscsi: osst: drop SCSI devie reference taken before
Date
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@163.com>
---
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

\
 
 \ /
  Last update: 2019-04-17 09:57    [W:0.036 / U:1.648 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site