Commit 0cc8d8df9bb931f1d4ab376f59d8ab8a49f9d4d4

Authored by YOSHIFUJI Hideaki / 吉藤英明
Committed by David S. Miller
1 parent 3f0d2ba0bd

netfilter: Use IS_ERR_OR_NULL().

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 3 changed files with 15 additions and 15 deletions Side-by-side Diff

net/ipv4/netfilter/arp_tables.c
... ... @@ -901,7 +901,7 @@
901 901 #endif
902 902 t = try_then_request_module(xt_find_table_lock(net, NFPROTO_ARP, name),
903 903 "arptable_%s", name);
904   - if (t && !IS_ERR(t)) {
  904 + if (!IS_ERR_OR_NULL(t)) {
905 905 struct arpt_getinfo info;
906 906 const struct xt_table_info *private = t->private;
907 907 #ifdef CONFIG_COMPAT
... ... @@ -958,7 +958,7 @@
958 958 }
959 959  
960 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 962 const struct xt_table_info *private = t->private;
963 963  
964 964 duprintf("t->private->number = %u\n",
... ... @@ -1001,7 +1001,7 @@
1001 1001  
1002 1002 t = try_then_request_module(xt_find_table_lock(net, NFPROTO_ARP, name),
1003 1003 "arptable_%s", name);
1004   - if (!t || IS_ERR(t)) {
  1004 + if (IS_ERR_OR_NULL(t)) {
1005 1005 ret = t ? PTR_ERR(t) : -ENOENT;
1006 1006 goto free_newinfo_counters_untrans;
1007 1007 }
... ... @@ -1158,7 +1158,7 @@
1158 1158 }
1159 1159  
1160 1160 t = xt_find_table_lock(net, NFPROTO_ARP, name);
1161   - if (!t || IS_ERR(t)) {
  1161 + if (IS_ERR_OR_NULL(t)) {
1162 1162 ret = t ? PTR_ERR(t) : -ENOENT;
1163 1163 goto free;
1164 1164 }
... ... @@ -1646,7 +1646,7 @@
1646 1646  
1647 1647 xt_compat_lock(NFPROTO_ARP);
1648 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 1650 const struct xt_table_info *private = t->private;
1651 1651 struct xt_table_info info;
1652 1652  
net/ipv4/netfilter/ip_tables.c
... ... @@ -1090,7 +1090,7 @@
1090 1090 #endif
1091 1091 t = try_then_request_module(xt_find_table_lock(net, AF_INET, name),
1092 1092 "iptable_%s", name);
1093   - if (t && !IS_ERR(t)) {
  1093 + if (!IS_ERR_OR_NULL(t)) {
1094 1094 struct ipt_getinfo info;
1095 1095 const struct xt_table_info *private = t->private;
1096 1096 #ifdef CONFIG_COMPAT
... ... @@ -1149,7 +1149,7 @@
1149 1149 }
1150 1150  
1151 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 1153 const struct xt_table_info *private = t->private;
1154 1154 duprintf("t->private->number = %u\n", private->number);
1155 1155 if (get.size == private->size)
... ... @@ -1189,7 +1189,7 @@
1189 1189  
1190 1190 t = try_then_request_module(xt_find_table_lock(net, AF_INET, name),
1191 1191 "iptable_%s", name);
1192   - if (!t || IS_ERR(t)) {
  1192 + if (IS_ERR_OR_NULL(t)) {
1193 1193 ret = t ? PTR_ERR(t) : -ENOENT;
1194 1194 goto free_newinfo_counters_untrans;
1195 1195 }
... ... @@ -1347,7 +1347,7 @@
1347 1347 }
1348 1348  
1349 1349 t = xt_find_table_lock(net, AF_INET, name);
1350   - if (!t || IS_ERR(t)) {
  1350 + if (IS_ERR_OR_NULL(t)) {
1351 1351 ret = t ? PTR_ERR(t) : -ENOENT;
1352 1352 goto free;
1353 1353 }
... ... @@ -1931,7 +1931,7 @@
1931 1931  
1932 1932 xt_compat_lock(AF_INET);
1933 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 1935 const struct xt_table_info *private = t->private;
1936 1936 struct xt_table_info info;
1937 1937 duprintf("t->private->number = %u\n", private->number);
net/ipv6/netfilter/ip6_tables.c
... ... @@ -1098,7 +1098,7 @@
1098 1098 #endif
1099 1099 t = try_then_request_module(xt_find_table_lock(net, AF_INET6, name),
1100 1100 "ip6table_%s", name);
1101   - if (t && !IS_ERR(t)) {
  1101 + if (!IS_ERR_OR_NULL(t)) {
1102 1102 struct ip6t_getinfo info;
1103 1103 const struct xt_table_info *private = t->private;
1104 1104 #ifdef CONFIG_COMPAT
... ... @@ -1157,7 +1157,7 @@
1157 1157 }
1158 1158  
1159 1159 t = xt_find_table_lock(net, AF_INET6, get.name);
1160   - if (t && !IS_ERR(t)) {
  1160 + if (!IS_ERR_OR_NULL(t)) {
1161 1161 struct xt_table_info *private = t->private;
1162 1162 duprintf("t->private->number = %u\n", private->number);
1163 1163 if (get.size == private->size)
... ... @@ -1197,7 +1197,7 @@
1197 1197  
1198 1198 t = try_then_request_module(xt_find_table_lock(net, AF_INET6, name),
1199 1199 "ip6table_%s", name);
1200   - if (!t || IS_ERR(t)) {
  1200 + if (IS_ERR_OR_NULL(t)) {
1201 1201 ret = t ? PTR_ERR(t) : -ENOENT;
1202 1202 goto free_newinfo_counters_untrans;
1203 1203 }
... ... @@ -1355,7 +1355,7 @@
1355 1355 }
1356 1356  
1357 1357 t = xt_find_table_lock(net, AF_INET6, name);
1358   - if (!t || IS_ERR(t)) {
  1358 + if (IS_ERR_OR_NULL(t)) {
1359 1359 ret = t ? PTR_ERR(t) : -ENOENT;
1360 1360 goto free;
1361 1361 }
... ... @@ -1939,7 +1939,7 @@
1939 1939  
1940 1940 xt_compat_lock(AF_INET6);
1941 1941 t = xt_find_table_lock(net, AF_INET6, get.name);
1942   - if (t && !IS_ERR(t)) {
  1942 + if (!IS_ERR_OR_NULL(t)) {
1943 1943 const struct xt_table_info *private = t->private;
1944 1944 struct xt_table_info info;
1945 1945 duprintf("t->private->number = %u\n", private->number);