c
// Add this flag to the appropriate structure
bool host_removed = false;

1 struct lpfc_nodelist *
2 lpfc_findnode_did(struct lpfc_vport *vport, uint32_t did)
3 {
4     struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
5     struct lpfc_nodelist *ndlp = NULL;
6     unsigned long iflags;
7     
8     if (host_removed) {
9         return NULL;
10     }
11     
12     spin_lock_irqsave(shost->host_lock, iflags);
13     ndlp = __lpfc_findnode_did(vport, did);
14     spin_unlock_irqrestore(shost->host_lock, iflags);
15     
16     return ndlp;
17 }

// Set the flag in lpfc_vport_delete before removing the host
649     host_removed = true;
650     fc_remove_host(shost);
651     scsi_remove_host(shost);
