summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorQuinn Tran <qtran@marvell.com>2019-02-15 23:37:16 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2019-02-20 00:58:36 +0100
commit192c4e9b9322ae445fa12914941e2278c7d4829f (patch)
tree8f7f3cdf1e6ec695278636cd611f345a4f0d6a07 /drivers/scsi
parentscsi: qla2xxx: Check for FW started flag before aborting (diff)
downloadlinux-192c4e9b9322ae445fa12914941e2278c7d4829f.tar.xz
linux-192c4e9b9322ae445fa12914941e2278c7d4829f.zip
scsi: qla2xxx: Prevent multiple ADISC commands per session
Add check to allow 1 discovery command per session to be sent. Signed-off-by: Quinn Tran <qtran@marvell.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 4480a5632c11..633ad7858af5 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -473,9 +473,11 @@ qla2x00_async_adisc(struct scsi_qla_host *vha, fc_port_t *fcport,
{
srb_t *sp;
struct srb_iocb *lio;
- int rval;
+ int rval = QLA_FUNCTION_FAILED;
+
+ if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT))
+ return rval;
- rval = QLA_FUNCTION_FAILED;
fcport->flags |= FCF_ASYNC_SENT;
sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL);
if (!sp)