Commit 3cab4468 authored by Vasu Dev's avatar Vasu Dev Committed by James Bottomley

[SCSI] libfc: defer releasing master lport until complete fcoe interface cleanuped up

The fcoe controller has back references, therefore defer
releasing master lport which gets freed along scsi_host_put
and then free it once fcoe interface is fully cleaned.
Signed-off-by: default avatarVasu Dev <vasu.dev@intel.com>
Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
Tested-by: default avatarRoss Brattain <ross.b.brattain@intel.com>
Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 061446a1
......@@ -472,6 +472,7 @@ static void fcoe_interface_cleanup(struct fcoe_interface *fcoe)
/* Release the self-reference taken during fcoe_interface_create() */
/* tear-down the FCoE controller */
fcoe_ctlr_destroy(fip);
scsi_host_put(fcoe->ctlr.lp->host);
kfree(fcoe);
dev_put(netdev);
module_put(THIS_MODULE);
......@@ -976,8 +977,12 @@ static void fcoe_if_destroy(struct fc_lport *lport)
/* Free memory used by statistical counters */
fc_lport_free_stats(lport);
/* Release the Scsi_Host */
scsi_host_put(lport->host);
/*
* Release the Scsi_Host for vport but hold on to
* master lport until it fcoe interface fully cleaned-up.
*/
if (lport->vport)
scsi_host_put(lport->host);
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment