Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 72979
b: refs/heads/master
c: 1dba323
h: refs/heads/master
i:
  72977: 127bbf4
  72975: 8c58cdc
v: v3
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Nov 1, 2007
1 parent a048084 commit 1e38f55
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 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: 6257ff2177ff02d7f260a7a501876aa41cb9a9f6
refs/heads/master: 1dba323b3f92cf4a475236763b0373cb7d49395d
23 changes: 11 additions & 12 deletions trunk/net/core/net_namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,38 +187,37 @@ static int register_pernet_operations(struct list_head *list,
struct net *net, *undo_net;
int error;

error = 0;
list_add_tail(&ops->list, list);
for_each_net(net) {
if (ops->init) {
if (ops->init) {
for_each_net(net) {
error = ops->init(net);
if (error)
goto out_undo;
}
}
out:
return error;
return 0;

out_undo:
/* If I have an error cleanup all namespaces I initialized */
list_del(&ops->list);
for_each_net(undo_net) {
if (undo_net == net)
goto undone;
if (ops->exit)
if (ops->exit) {
for_each_net(undo_net) {
if (undo_net == net)
goto undone;
ops->exit(undo_net);
}
}
undone:
goto out;
return error;
}

static void unregister_pernet_operations(struct pernet_operations *ops)
{
struct net *net;

list_del(&ops->list);
for_each_net(net)
if (ops->exit)
if (ops->exit)
for_each_net(net)
ops->exit(net);
}

Expand Down

0 comments on commit 1e38f55

Please sign in to comment.