*/
        if (phba->sli_rev == LPFC_SLI_REV4 &&
            (vport && vport->port_type == LPFC_NPIV_PORT) &&
+           !(ndlp->fc4_xpt_flags & SCSI_XPT_REGD) &&
            ndlp->nlp_flag & NLP_RELEASE_RPI) {
                lpfc_sli4_free_rpi(phba, ndlp->nlp_rpi);
                spin_lock_irq(&ndlp->lock);
        }
 
        /* The NPIV instance is rejecting this unsolicited ELS. Make sure the
-        * node's assigned RPI needs to be released as this node will get
-        * freed.
+        * node's assigned RPI gets released provided this node is not already
+        * registered with the transport.
         */
        if (phba->sli_rev == LPFC_SLI_REV4 &&
-           vport->port_type == LPFC_NPIV_PORT) {
+           vport->port_type == LPFC_NPIV_PORT &&
+           !(ndlp->fc4_xpt_flags & SCSI_XPT_REGD)) {
                spin_lock_irq(&ndlp->lock);
                ndlp->nlp_flag |= NLP_RELEASE_RPI;
                spin_unlock_irq(&ndlp->lock);