Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 180685
b: refs/heads/master
c: 6409ea6
h: refs/heads/master
i:
  180683: c078c9c
v: v3
  • Loading branch information
Rob Love authored and James Bottomley committed Feb 17, 2010
1 parent b61b4bb commit d521783
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f47dd855d9e64a5d499a93e858a82bc5e7b21345
refs/heads/master: 6409ea65b3b81ef693cbbc7c4b2300e50a4219dd
18 changes: 16 additions & 2 deletions trunk/drivers/scsi/fcoe/fcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -2009,6 +2009,8 @@ static int fcoe_destroy(const char *buffer, struct kernel_param *kp)
fcoe_interface_cleanup(fcoe);
rtnl_unlock();
fcoe_if_destroy(fcoe->ctlr.lp);
module_put(THIS_MODULE);

out_putdev:
dev_put(netdev);
out_nodev:
Expand Down Expand Up @@ -2059,6 +2061,11 @@ static int fcoe_create(const char *buffer, struct kernel_param *kp)
}
#endif

if (!try_module_get(THIS_MODULE)) {
rc = -EINVAL;
goto out_nomod;
}

rtnl_lock();
netdev = fcoe_if_to_netdev(buffer);
if (!netdev) {
Expand Down Expand Up @@ -2099,17 +2106,24 @@ static int fcoe_create(const char *buffer, struct kernel_param *kp)
if (!fcoe_link_ok(lport))
fcoe_ctlr_link_up(&fcoe->ctlr);

rc = 0;
out_free:
/*
* Release from init in fcoe_interface_create(), on success lport
* should be holding a reference taken in fcoe_if_create().
*/
fcoe_interface_put(fcoe);
dev_put(netdev);
rtnl_unlock();
mutex_unlock(&fcoe_config_mutex);

return 0;
out_free:
fcoe_interface_put(fcoe);
out_putdev:
dev_put(netdev);
out_nodev:
rtnl_unlock();
module_put(THIS_MODULE);
out_nomod:
mutex_unlock(&fcoe_config_mutex);
return rc;
}
Expand Down

0 comments on commit d521783

Please sign in to comment.