Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 194519
b: refs/heads/master
c: 3a73702
h: refs/heads/master
i:
  194517: edd61f3
  194515: 0cac5b0
  194511: 28e4602
v: v3
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Apr 23, 2010
1 parent 9424cd2 commit f6afcb2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 29 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: e773aaff8295e7f3428d9cf6f8a476a33de00716
refs/heads/master: 3a737028630bb3c2b9efc38b9ddef2e09b06b808
29 changes: 1 addition & 28 deletions trunk/net/l2tp/l2tp_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,43 +276,16 @@ static int l2tp_eth_create(struct net *net, u32 tunnel_id, u32 session_id, u32 p

static __net_init int l2tp_eth_init_net(struct net *net)
{
struct l2tp_eth_net *pn;
int err;

pn = kzalloc(sizeof(*pn), GFP_KERNEL);
if (!pn)
return -ENOMEM;
struct l2tp_eth_net *pn = net_generic(net, l2tp_eth_net_id);

INIT_LIST_HEAD(&pn->l2tp_eth_dev_list);
spin_lock_init(&pn->l2tp_eth_lock);

err = net_assign_generic(net, l2tp_eth_net_id, pn);
if (err)
goto out;

return 0;

out:
kfree(pn);
return err;
}

static __net_exit void l2tp_eth_exit_net(struct net *net)
{
struct l2tp_eth_net *pn;

pn = net_generic(net, l2tp_eth_net_id);
/*
* if someone has cached our net then
* further net_generic call will return NULL
*/
net_assign_generic(net, l2tp_eth_net_id, NULL);
kfree(pn);
}

static __net_initdata struct pernet_operations l2tp_eth_net_ops = {
.init = l2tp_eth_init_net,
.exit = l2tp_eth_exit_net,
.id = &l2tp_eth_net_id,
.size = sizeof(struct l2tp_eth_net),
};
Expand Down

0 comments on commit f6afcb2

Please sign in to comment.