summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_debug.c
diff options
context:
space:
mode:
authorNiklas Cassel <niklas.cassel@wdc.com>2020-08-21 15:00:07 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2020-08-25 05:02:18 +0200
commit75d46c6d15efabc5176a5e2694ee236f02ee72ef (patch)
tree27e9c394ddbca88faa2e7db738a66149175d2036 /drivers/scsi/scsi_debug.c
parentscsi: libcxgbi: Fix a use after free in cxgbi_conn_xmit_pdu() (diff)
downloadlinux-75d46c6d15efabc5176a5e2694ee236f02ee72ef.tar.xz
linux-75d46c6d15efabc5176a5e2694ee236f02ee72ef.zip
scsi: scsi_debug: Remove superfluous close zone in resp_open_zone()
resp_open_zone() always calls zbc_open_zone() with parameter explicit set to true. If zbc_open_zone() is called with parameter explicit set to true, and the current zone state is implicit open, it will call zbc_close_zone() on the zone before proceeding. Therefore, there is no need for resp_open_zone() to call zbc_close_zone() on an implicitly open zone before calling zbc_open_zone(). Remove superfluous close zone in resp_open_zone(). Link: https://lore.kernel.org/r/20200821130007.39938-1-niklas.cassel@wdc.com Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com> Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/scsi_debug.c')
-rw-r--r--drivers/scsi/scsi_debug.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 139f0073da37..1ad7260d4758 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -4482,8 +4482,6 @@ static int resp_open_zone(struct scsi_cmnd *scp, struct sdebug_dev_info *devip)
goto fini;
}
- if (zc == ZC2_IMPLICIT_OPEN)
- zbc_close_zone(devip, zsp);
zbc_open_zone(devip, zsp, true);
fini:
write_unlock(macc_lckp);