diff options
author | Wu Fengguang <fengguang.wu@intel.com> | 2012-07-28 10:45:50 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2012-08-13 20:31:47 -0400 |
commit | 19e303d67dc2e68a7f14b0baf7949195d7327145 (patch) | |
tree | 5fc3ce37baf39363a23245cb69845f0c0b284021 /net | |
parent | 3654e61137db891f5312e6dd813b961484b5fdf3 (diff) |
netfilter: PTR_RET can be used
This quiets the coccinelle warnings:
net/bridge/netfilter/ebtable_filter.c:107:1-3: WARNING: PTR_RET can be used
net/bridge/netfilter/ebtable_nat.c:107:1-3: WARNING: PTR_RET can be used
net/ipv6/netfilter/ip6table_filter.c:65:1-3: WARNING: PTR_RET can be used
net/ipv6/netfilter/ip6table_mangle.c:100:1-3: WARNING: PTR_RET can be used
net/ipv6/netfilter/ip6table_raw.c:44:1-3: WARNING: PTR_RET can be used
net/ipv6/netfilter/ip6table_security.c:62:1-3: WARNING: PTR_RET can be used
net/ipv4/netfilter/iptable_filter.c:72:1-3: WARNING: PTR_RET can be used
net/ipv4/netfilter/iptable_mangle.c:107:1-3: WARNING: PTR_RET can be used
net/ipv4/netfilter/iptable_raw.c:51:1-3: WARNING: PTR_RET can be used
net/ipv4/netfilter/iptable_security.c:70:1-3: WARNING: PTR_RET can be used
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/bridge/netfilter/ebtable_filter.c | 4 | ||||
-rw-r--r-- | net/bridge/netfilter/ebtable_nat.c | 4 | ||||
-rw-r--r-- | net/ipv4/netfilter/iptable_filter.c | 4 | ||||
-rw-r--r-- | net/ipv4/netfilter/iptable_mangle.c | 4 | ||||
-rw-r--r-- | net/ipv4/netfilter/iptable_raw.c | 4 | ||||
-rw-r--r-- | net/ipv4/netfilter/iptable_security.c | 5 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6table_filter.c | 4 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6table_mangle.c | 4 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6table_raw.c | 4 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6table_security.c | 5 |
10 files changed, 10 insertions, 32 deletions
diff --git a/net/bridge/netfilter/ebtable_filter.c b/net/bridge/netfilter/ebtable_filter.c index 42e6bd094574..3c2e9dced9e0 100644 --- a/net/bridge/netfilter/ebtable_filter.c +++ b/net/bridge/netfilter/ebtable_filter.c | |||
@@ -100,9 +100,7 @@ static struct nf_hook_ops ebt_ops_filter[] __read_mostly = { | |||
100 | static int __net_init frame_filter_net_init(struct net *net) | 100 | static int __net_init frame_filter_net_init(struct net *net) |
101 | { | 101 | { |
102 | net->xt.frame_filter = ebt_register_table(net, &frame_filter); | 102 | net->xt.frame_filter = ebt_register_table(net, &frame_filter); |
103 | if (IS_ERR(net->xt.frame_filter)) | 103 | return PTR_RET(net->xt.frame_filter); |
104 | return PTR_ERR(net->xt.frame_filter); | ||
105 | return 0; | ||
106 | } | 104 | } |
107 | 105 | ||
108 | static void __net_exit frame_filter_net_exit(struct net *net) | 106 | static void __net_exit frame_filter_net_exit(struct net *net) |
diff --git a/net/bridge/netfilter/ebtable_nat.c b/net/bridge/netfilter/ebtable_nat.c index 6dc2f878ae05..10871bc77908 100644 --- a/net/bridge/netfilter/ebtable_nat.c +++ b/net/bridge/netfilter/ebtable_nat.c | |||
@@ -100,9 +100,7 @@ static struct nf_hook_ops ebt_ops_nat[] __read_mostly = { | |||
100 | static int __net_init frame_nat_net_init(struct net *net) | 100 | static int __net_init frame_nat_net_init(struct net *net) |
101 | { | 101 | { |
102 | net->xt.frame_nat = ebt_register_table(net, &frame_nat); | 102 | net->xt.frame_nat = ebt_register_table(net, &frame_nat); |
103 | if (IS_ERR(net->xt.frame_nat)) | 103 | return PTR_RET(net->xt.frame_nat); |
104 | return PTR_ERR(net->xt.frame_nat); | ||
105 | return 0; | ||
106 | } | 104 | } |
107 | 105 | ||
108 | static void __net_exit frame_nat_net_exit(struct net *net) | 106 | static void __net_exit frame_nat_net_exit(struct net *net) |
diff --git a/net/ipv4/netfilter/iptable_filter.c b/net/ipv4/netfilter/iptable_filter.c index 851acec852d2..d20cc374025c 100644 --- a/net/ipv4/netfilter/iptable_filter.c +++ b/net/ipv4/netfilter/iptable_filter.c | |||
@@ -69,9 +69,7 @@ static int __net_init iptable_filter_net_init(struct net *net) | |||
69 | net->ipv4.iptable_filter = | 69 | net->ipv4.iptable_filter = |
70 | ipt_register_table(net, &packet_filter, repl); | 70 | ipt_register_table(net, &packet_filter, repl); |
71 | kfree(repl); | 71 | kfree(repl); |
72 | if (IS_ERR(net->ipv4.iptable_filter)) | 72 | return PTR_RET(net->ipv4.iptable_filter); |
73 | return PTR_ERR(net->ipv4.iptable_filter); | ||
74 | return 0; | ||
75 | } | 73 | } |
76 | 74 | ||
77 | static void __net_exit iptable_filter_net_exit(struct net *net) | 75 | static void __net_exit iptable_filter_net_exit(struct net *net) |
diff --git a/net/ipv4/netfilter/iptable_mangle.c b/net/ipv4/netfilter/iptable_mangle.c index aef5d1fbe77d..f38b94288cf5 100644 --- a/net/ipv4/netfilter/iptable_mangle.c +++ b/net/ipv4/netfilter/iptable_mangle.c | |||
@@ -104,9 +104,7 @@ static int __net_init iptable_mangle_net_init(struct net *net) | |||
104 | net->ipv4.iptable_mangle = | 104 | net->ipv4.iptable_mangle = |
105 | ipt_register_table(net, &packet_mangler, repl); | 105 | ipt_register_table(net, &packet_mangler, repl); |
106 | kfree(repl); | 106 | kfree(repl); |
107 | if (IS_ERR(net->ipv4.iptable_mangle)) | 107 | return PTR_RET(net->ipv4.iptable_mangle); |
108 | return PTR_ERR(net->ipv4.iptable_mangle); | ||
109 | return 0; | ||
110 | } | 108 | } |
111 | 109 | ||
112 | static void __net_exit iptable_mangle_net_exit(struct net *net) | 110 | static void __net_exit iptable_mangle_net_exit(struct net *net) |
diff --git a/net/ipv4/netfilter/iptable_raw.c b/net/ipv4/netfilter/iptable_raw.c index 07fb710cd722..b21e2191e2f5 100644 --- a/net/ipv4/netfilter/iptable_raw.c +++ b/net/ipv4/netfilter/iptable_raw.c | |||
@@ -48,9 +48,7 @@ static int __net_init iptable_raw_net_init(struct net *net) | |||
48 | net->ipv4.iptable_raw = | 48 | net->ipv4.iptable_raw = |
49 | ipt_register_table(net, &packet_raw, repl); | 49 | ipt_register_table(net, &packet_raw, repl); |
50 | kfree(repl); | 50 | kfree(repl); |
51 | if (IS_ERR(net->ipv4.iptable_raw)) | 51 | return PTR_RET(net->ipv4.iptable_raw); |
52 | return PTR_ERR(net->ipv4.iptable_raw); | ||
53 | return 0; | ||
54 | } | 52 | } |
55 | 53 | ||
56 | static void __net_exit iptable_raw_net_exit(struct net *net) | 54 | static void __net_exit iptable_raw_net_exit(struct net *net) |
diff --git a/net/ipv4/netfilter/iptable_security.c b/net/ipv4/netfilter/iptable_security.c index be45bdc4c602..b283d8e2601a 100644 --- a/net/ipv4/netfilter/iptable_security.c +++ b/net/ipv4/netfilter/iptable_security.c | |||
@@ -66,10 +66,7 @@ static int __net_init iptable_security_net_init(struct net *net) | |||
66 | net->ipv4.iptable_security = | 66 | net->ipv4.iptable_security = |
67 | ipt_register_table(net, &security_table, repl); | 67 | ipt_register_table(net, &security_table, repl); |
68 | kfree(repl); | 68 | kfree(repl); |
69 | if (IS_ERR(net->ipv4.iptable_security)) | 69 | return PTR_RET(net->ipv4.iptable_security); |
70 | return PTR_ERR(net->ipv4.iptable_security); | ||
71 | |||
72 | return 0; | ||
73 | } | 70 | } |
74 | 71 | ||
75 | static void __net_exit iptable_security_net_exit(struct net *net) | 72 | static void __net_exit iptable_security_net_exit(struct net *net) |
diff --git a/net/ipv6/netfilter/ip6table_filter.c b/net/ipv6/netfilter/ip6table_filter.c index 325e59a0224f..beb5777d2043 100644 --- a/net/ipv6/netfilter/ip6table_filter.c +++ b/net/ipv6/netfilter/ip6table_filter.c | |||
@@ -61,9 +61,7 @@ static int __net_init ip6table_filter_net_init(struct net *net) | |||
61 | net->ipv6.ip6table_filter = | 61 | net->ipv6.ip6table_filter = |
62 | ip6t_register_table(net, &packet_filter, repl); | 62 | ip6t_register_table(net, &packet_filter, repl); |
63 | kfree(repl); | 63 | kfree(repl); |
64 | if (IS_ERR(net->ipv6.ip6table_filter)) | 64 | return PTR_RET(net->ipv6.ip6table_filter); |
65 | return PTR_ERR(net->ipv6.ip6table_filter); | ||
66 | return 0; | ||
67 | } | 65 | } |
68 | 66 | ||
69 | static void __net_exit ip6table_filter_net_exit(struct net *net) | 67 | static void __net_exit ip6table_filter_net_exit(struct net *net) |
diff --git a/net/ipv6/netfilter/ip6table_mangle.c b/net/ipv6/netfilter/ip6table_mangle.c index 4d782405f125..7431121b87de 100644 --- a/net/ipv6/netfilter/ip6table_mangle.c +++ b/net/ipv6/netfilter/ip6table_mangle.c | |||
@@ -97,9 +97,7 @@ static int __net_init ip6table_mangle_net_init(struct net *net) | |||
97 | net->ipv6.ip6table_mangle = | 97 | net->ipv6.ip6table_mangle = |
98 | ip6t_register_table(net, &packet_mangler, repl); | 98 | ip6t_register_table(net, &packet_mangler, repl); |
99 | kfree(repl); | 99 | kfree(repl); |
100 | if (IS_ERR(net->ipv6.ip6table_mangle)) | 100 | return PTR_RET(net->ipv6.ip6table_mangle); |
101 | return PTR_ERR(net->ipv6.ip6table_mangle); | ||
102 | return 0; | ||
103 | } | 101 | } |
104 | 102 | ||
105 | static void __net_exit ip6table_mangle_net_exit(struct net *net) | 103 | static void __net_exit ip6table_mangle_net_exit(struct net *net) |
diff --git a/net/ipv6/netfilter/ip6table_raw.c b/net/ipv6/netfilter/ip6table_raw.c index 5b9926a011bd..60d1bddff7a0 100644 --- a/net/ipv6/netfilter/ip6table_raw.c +++ b/net/ipv6/netfilter/ip6table_raw.c | |||
@@ -40,9 +40,7 @@ static int __net_init ip6table_raw_net_init(struct net *net) | |||
40 | net->ipv6.ip6table_raw = | 40 | net->ipv6.ip6table_raw = |
41 | ip6t_register_table(net, &packet_raw, repl); | 41 | ip6t_register_table(net, &packet_raw, repl); |
42 | kfree(repl); | 42 | kfree(repl); |
43 | if (IS_ERR(net->ipv6.ip6table_raw)) | 43 | return PTR_RET(net->ipv6.ip6table_raw); |
44 | return PTR_ERR(net->ipv6.ip6table_raw); | ||
45 | return 0; | ||
46 | } | 44 | } |
47 | 45 | ||
48 | static void __net_exit ip6table_raw_net_exit(struct net *net) | 46 | static void __net_exit ip6table_raw_net_exit(struct net *net) |
diff --git a/net/ipv6/netfilter/ip6table_security.c b/net/ipv6/netfilter/ip6table_security.c index 91aa2b4d83c9..db155351339c 100644 --- a/net/ipv6/netfilter/ip6table_security.c +++ b/net/ipv6/netfilter/ip6table_security.c | |||
@@ -58,10 +58,7 @@ static int __net_init ip6table_security_net_init(struct net *net) | |||
58 | net->ipv6.ip6table_security = | 58 | net->ipv6.ip6table_security = |
59 | ip6t_register_table(net, &security_table, repl); | 59 | ip6t_register_table(net, &security_table, repl); |
60 | kfree(repl); | 60 | kfree(repl); |
61 | if (IS_ERR(net->ipv6.ip6table_security)) | 61 | return PTR_RET(net->ipv6.ip6table_security); |
62 | return PTR_ERR(net->ipv6.ip6table_security); | ||
63 | |||
64 | return 0; | ||
65 | } | 62 | } |
66 | 63 | ||
67 | static void __net_exit ip6table_security_net_exit(struct net *net) | 64 | static void __net_exit ip6table_security_net_exit(struct net *net) |