diff options
author | YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org> | 2013-01-22 01:33:09 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-22 14:28:29 -0500 |
commit | 0cc8d8df9bb931f1d4ab376f59d8ab8a49f9d4d4 (patch) | |
tree | d9e37632ee0ae1e810bbce796ee4f8c096842290 /net/ipv4 | |
parent | 3f0d2ba0bd7d7dc7b461bc7d2cd3c297b843a3a8 (diff) |
netfilter: Use IS_ERR_OR_NULL().
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/netfilter/arp_tables.c | 10 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_tables.c | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c index 3ea4127404d6..7dc6a9743592 100644 --- a/net/ipv4/netfilter/arp_tables.c +++ b/net/ipv4/netfilter/arp_tables.c | |||
@@ -901,7 +901,7 @@ static int get_info(struct net *net, void __user *user, | |||
901 | #endif | 901 | #endif |
902 | t = try_then_request_module(xt_find_table_lock(net, NFPROTO_ARP, name), | 902 | t = try_then_request_module(xt_find_table_lock(net, NFPROTO_ARP, name), |
903 | "arptable_%s", name); | 903 | "arptable_%s", name); |
904 | if (t && !IS_ERR(t)) { | 904 | if (!IS_ERR_OR_NULL(t)) { |
905 | struct arpt_getinfo info; | 905 | struct arpt_getinfo info; |
906 | const struct xt_table_info *private = t->private; | 906 | const struct xt_table_info *private = t->private; |
907 | #ifdef CONFIG_COMPAT | 907 | #ifdef CONFIG_COMPAT |
@@ -958,7 +958,7 @@ static int get_entries(struct net *net, struct arpt_get_entries __user *uptr, | |||
958 | } | 958 | } |
959 | 959 | ||
960 | t = xt_find_table_lock(net, NFPROTO_ARP, get.name); | 960 | t = xt_find_table_lock(net, NFPROTO_ARP, get.name); |
961 | if (t && !IS_ERR(t)) { | 961 | if (!IS_ERR_OR_NULL(t)) { |
962 | const struct xt_table_info *private = t->private; | 962 | const struct xt_table_info *private = t->private; |
963 | 963 | ||
964 | duprintf("t->private->number = %u\n", | 964 | duprintf("t->private->number = %u\n", |
@@ -1001,7 +1001,7 @@ static int __do_replace(struct net *net, const char *name, | |||
1001 | 1001 | ||
1002 | t = try_then_request_module(xt_find_table_lock(net, NFPROTO_ARP, name), | 1002 | t = try_then_request_module(xt_find_table_lock(net, NFPROTO_ARP, name), |
1003 | "arptable_%s", name); | 1003 | "arptable_%s", name); |
1004 | if (!t || IS_ERR(t)) { | 1004 | if (IS_ERR_OR_NULL(t)) { |
1005 | ret = t ? PTR_ERR(t) : -ENOENT; | 1005 | ret = t ? PTR_ERR(t) : -ENOENT; |
1006 | goto free_newinfo_counters_untrans; | 1006 | goto free_newinfo_counters_untrans; |
1007 | } | 1007 | } |
@@ -1158,7 +1158,7 @@ static int do_add_counters(struct net *net, const void __user *user, | |||
1158 | } | 1158 | } |
1159 | 1159 | ||
1160 | t = xt_find_table_lock(net, NFPROTO_ARP, name); | 1160 | t = xt_find_table_lock(net, NFPROTO_ARP, name); |
1161 | if (!t || IS_ERR(t)) { | 1161 | if (IS_ERR_OR_NULL(t)) { |
1162 | ret = t ? PTR_ERR(t) : -ENOENT; | 1162 | ret = t ? PTR_ERR(t) : -ENOENT; |
1163 | goto free; | 1163 | goto free; |
1164 | } | 1164 | } |
@@ -1646,7 +1646,7 @@ static int compat_get_entries(struct net *net, | |||
1646 | 1646 | ||
1647 | xt_compat_lock(NFPROTO_ARP); | 1647 | xt_compat_lock(NFPROTO_ARP); |
1648 | t = xt_find_table_lock(net, NFPROTO_ARP, get.name); | 1648 | t = xt_find_table_lock(net, NFPROTO_ARP, get.name); |
1649 | if (t && !IS_ERR(t)) { | 1649 | if (!IS_ERR_OR_NULL(t)) { |
1650 | const struct xt_table_info *private = t->private; | 1650 | const struct xt_table_info *private = t->private; |
1651 | struct xt_table_info info; | 1651 | struct xt_table_info info; |
1652 | 1652 | ||
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index 17c5e06da662..3efcf87400c3 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c | |||
@@ -1090,7 +1090,7 @@ static int get_info(struct net *net, void __user *user, | |||
1090 | #endif | 1090 | #endif |
1091 | t = try_then_request_module(xt_find_table_lock(net, AF_INET, name), | 1091 | t = try_then_request_module(xt_find_table_lock(net, AF_INET, name), |
1092 | "iptable_%s", name); | 1092 | "iptable_%s", name); |
1093 | if (t && !IS_ERR(t)) { | 1093 | if (!IS_ERR_OR_NULL(t)) { |
1094 | struct ipt_getinfo info; | 1094 | struct ipt_getinfo info; |
1095 | const struct xt_table_info *private = t->private; | 1095 | const struct xt_table_info *private = t->private; |
1096 | #ifdef CONFIG_COMPAT | 1096 | #ifdef CONFIG_COMPAT |
@@ -1149,7 +1149,7 @@ get_entries(struct net *net, struct ipt_get_entries __user *uptr, | |||
1149 | } | 1149 | } |
1150 | 1150 | ||
1151 | t = xt_find_table_lock(net, AF_INET, get.name); | 1151 | t = xt_find_table_lock(net, AF_INET, get.name); |
1152 | if (t && !IS_ERR(t)) { | 1152 | if (!IS_ERR_OR_NULL(t)) { |
1153 | const struct xt_table_info *private = t->private; | 1153 | const struct xt_table_info *private = t->private; |
1154 | duprintf("t->private->number = %u\n", private->number); | 1154 | duprintf("t->private->number = %u\n", private->number); |
1155 | if (get.size == private->size) | 1155 | if (get.size == private->size) |
@@ -1189,7 +1189,7 @@ __do_replace(struct net *net, const char *name, unsigned int valid_hooks, | |||
1189 | 1189 | ||
1190 | t = try_then_request_module(xt_find_table_lock(net, AF_INET, name), | 1190 | t = try_then_request_module(xt_find_table_lock(net, AF_INET, name), |
1191 | "iptable_%s", name); | 1191 | "iptable_%s", name); |
1192 | if (!t || IS_ERR(t)) { | 1192 | if (IS_ERR_OR_NULL(t)) { |
1193 | ret = t ? PTR_ERR(t) : -ENOENT; | 1193 | ret = t ? PTR_ERR(t) : -ENOENT; |
1194 | goto free_newinfo_counters_untrans; | 1194 | goto free_newinfo_counters_untrans; |
1195 | } | 1195 | } |
@@ -1347,7 +1347,7 @@ do_add_counters(struct net *net, const void __user *user, | |||
1347 | } | 1347 | } |
1348 | 1348 | ||
1349 | t = xt_find_table_lock(net, AF_INET, name); | 1349 | t = xt_find_table_lock(net, AF_INET, name); |
1350 | if (!t || IS_ERR(t)) { | 1350 | if (IS_ERR_OR_NULL(t)) { |
1351 | ret = t ? PTR_ERR(t) : -ENOENT; | 1351 | ret = t ? PTR_ERR(t) : -ENOENT; |
1352 | goto free; | 1352 | goto free; |
1353 | } | 1353 | } |
@@ -1931,7 +1931,7 @@ compat_get_entries(struct net *net, struct compat_ipt_get_entries __user *uptr, | |||
1931 | 1931 | ||
1932 | xt_compat_lock(AF_INET); | 1932 | xt_compat_lock(AF_INET); |
1933 | t = xt_find_table_lock(net, AF_INET, get.name); | 1933 | t = xt_find_table_lock(net, AF_INET, get.name); |
1934 | if (t && !IS_ERR(t)) { | 1934 | if (!IS_ERR_OR_NULL(t)) { |
1935 | const struct xt_table_info *private = t->private; | 1935 | const struct xt_table_info *private = t->private; |
1936 | struct xt_table_info info; | 1936 | struct xt_table_info info; |
1937 | duprintf("t->private->number = %u\n", private->number); | 1937 | duprintf("t->private->number = %u\n", private->number); |