Merge tag 'nvme-5.14-2021-07-22' of git://git.infradead.org/nvme into block-5.14
[linux-2.6-block.git] / drivers / nvme / target / fc.c
index 19e113240fff91ce9d17b6e1ffa2254eaa13b650..22b5108168a6a2d2bfd62b047aaf5c2cb9522e53 100644 (file)
@@ -2510,13 +2510,6 @@ nvmet_fc_handle_fcp_rqst(struct nvmet_fc_tgtport *tgtport,
        u32 xfrlen = be32_to_cpu(cmdiu->data_len);
        int ret;
 
-       /*
-        * if there is no nvmet mapping to the targetport there
-        * shouldn't be requests. just terminate them.
-        */
-       if (!tgtport->pe)
-               goto transport_error;
-
        /*
         * Fused commands are currently not supported in the linux
         * implementation.
@@ -2544,7 +2537,8 @@ nvmet_fc_handle_fcp_rqst(struct nvmet_fc_tgtport *tgtport,
 
        fod->req.cmd = &fod->cmdiubuf.sqe;
        fod->req.cqe = &fod->rspiubuf.cqe;
-       fod->req.port = tgtport->pe->port;
+       if (tgtport->pe)
+               fod->req.port = tgtport->pe->port;
 
        /* clear any response payload */
        memset(&fod->rspiubuf, 0, sizeof(fod->rspiubuf));