Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 181363
b: refs/heads/master
c: e9ee2cf
h: refs/heads/master
i:
  181361: 9a5a544
  181359: d641dd6
v: v3
  • Loading branch information
Robert Love authored and James Bottomley committed Feb 17, 2010
1 parent 95ab455 commit 4081f9c
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: 03bf7a5af58e07aa13ea61993f5892f733b6f46d
refs/heads/master: e9ee2cf438066aa02df98db959733e1547432983
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 4081f9c

Please sign in to comment.