On 6/15/19 12:10 AM, Himanshu Madhani wrote: > From: Quinn Tran <qutran@xxxxxxxxxxx> > > - on session delete or chip reset, reject all NVME commands. > - on NVME command submission error, free srb resource. > > Signed-off-by: Quinn Tran <qutran@xxxxxxxxxxx> > Signed-off-by: Himanshu Madhani <hmadhani@xxxxxxxxxxx> > --- > drivers/scsi/qla2xxx/qla_nvme.c | 20 +++++++++++++------- > 1 file changed, 13 insertions(+), 7 deletions(-) > > diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c > index 99220a3cf734..ead10e1a81fc 100644 > --- a/drivers/scsi/qla2xxx/qla_nvme.c > +++ b/drivers/scsi/qla2xxx/qla_nvme.c > @@ -253,6 +253,10 @@ static int qla_nvme_ls_req(struct nvme_fc_local_port *lport, > > vha = fcport->vha; > ha = vha->hw; > + > + if (!ha->flags.fw_started || (fcport && fcport->deleted)) > + return rval; > + > /* Alloc SRB structure */ > sp = qla2x00_get_sp(vha, fcport, GFP_ATOMIC); > if (!sp) > @@ -284,6 +288,7 @@ static int qla_nvme_ls_req(struct nvme_fc_local_port *lport, > "qla2x00_start_sp failed = %d\n", rval); > atomic_dec(&sp->ref_count); > wake_up(&sp->nvme_ls_waitq); > + sp->free(sp); > return rval; > } > > @@ -500,7 +505,7 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport, > > vha = fcport->vha; > > - if (test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags)) > + if ((qpair && !qpair->fw_started) || (fcport && fcport->deleted)) > return rval; > > /* Huh ? So 'fcport == NULL' is okay here? I seriously doubt this ... Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@xxxxxxx +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg)