diff options
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/em_ipset.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/sched/em_ipset.c b/net/sched/em_ipset.c index 938b7cbf5627..1ac41d3de5c3 100644 --- a/net/sched/em_ipset.c +++ b/net/sched/em_ipset.c | |||
@@ -24,11 +24,12 @@ static int em_ipset_change(struct tcf_proto *tp, void *data, int data_len, | |||
24 | { | 24 | { |
25 | struct xt_set_info *set = data; | 25 | struct xt_set_info *set = data; |
26 | ip_set_id_t index; | 26 | ip_set_id_t index; |
27 | struct net *net = qdisc_dev(tp->q)->nd_net; | ||
27 | 28 | ||
28 | if (data_len != sizeof(*set)) | 29 | if (data_len != sizeof(*set)) |
29 | return -EINVAL; | 30 | return -EINVAL; |
30 | 31 | ||
31 | index = ip_set_nfnl_get_byindex(set->index); | 32 | index = ip_set_nfnl_get_byindex(net, set->index); |
32 | if (index == IPSET_INVALID_ID) | 33 | if (index == IPSET_INVALID_ID) |
33 | return -ENOENT; | 34 | return -ENOENT; |
34 | 35 | ||
@@ -37,7 +38,7 @@ static int em_ipset_change(struct tcf_proto *tp, void *data, int data_len, | |||
37 | if (em->data) | 38 | if (em->data) |
38 | return 0; | 39 | return 0; |
39 | 40 | ||
40 | ip_set_nfnl_put(index); | 41 | ip_set_nfnl_put(net, index); |
41 | return -ENOMEM; | 42 | return -ENOMEM; |
42 | } | 43 | } |
43 | 44 | ||
@@ -45,7 +46,7 @@ static void em_ipset_destroy(struct tcf_proto *p, struct tcf_ematch *em) | |||
45 | { | 46 | { |
46 | const struct xt_set_info *set = (const void *) em->data; | 47 | const struct xt_set_info *set = (const void *) em->data; |
47 | if (set) { | 48 | if (set) { |
48 | ip_set_nfnl_put(set->index); | 49 | ip_set_nfnl_put(qdisc_dev(p->q)->nd_net, set->index); |
49 | kfree((void *) em->data); | 50 | kfree((void *) em->data); |
50 | } | 51 | } |
51 | } | 52 | } |