Skip to content

Commit

Permalink
[SCSI] fcoe: fix fcoe module ref counting
Browse files Browse the repository at this point in the history
Currently fcoe module ref count is used for tracking
active fcoe instances, it means each fcoe instance create
increments the count while destroy dec the count.

The dec is done only if fcoe instance is destroyed from
/sysfs but not if destroyed due to NETDEV_UNREGISTER event.
So this patch moves only module_put doing dec to common
fcoe_if_destroy function, so that dec would occur on ever
fcoe instance destroy.

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
Vasu Dev authored and James Bottomley committed May 17, 2010
1 parent fb83153 commit 15af974
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/fcoe/fcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,7 @@ static void fcoe_if_destroy(struct fc_lport *lport)

/* Release the Scsi_Host */
scsi_host_put(lport->host);
module_put(THIS_MODULE);
}

/**
Expand Down Expand Up @@ -2034,7 +2035,6 @@ static int fcoe_destroy(const char *buffer, struct kernel_param *kp)
fcoe_interface_cleanup(fcoe);
/* RTNL mutex is dropped by fcoe_if_destroy */
fcoe_if_destroy(fcoe->ctlr.lp);
module_put(THIS_MODULE);

out_putdev:
dev_put(netdev);
Expand Down

0 comments on commit 15af974

Please sign in to comment.