Skip to content

Commit

Permalink
[NETFILTER]: x_tables: fix xt_register_table error propagation
Browse files Browse the repository at this point in the history
When xt_register_table fails the error is not properly propagated back.
Based on patch by Lepton Wu <ytht.net@gmail.com>.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Jun 29, 2006
1 parent bf7e851 commit da298d3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion net/ipv4/netfilter/arp_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,8 @@ int arpt_register_table(struct arpt_table *table,
return ret;
}

if (xt_register_table(table, &bootstrap, newinfo) != 0) {
ret = xt_register_table(table, &bootstrap, newinfo);
if (ret != 0) {
xt_free_table_info(newinfo);
return ret;
}
Expand Down
3 changes: 2 additions & 1 deletion net/ipv4/netfilter/ip_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -2113,7 +2113,8 @@ int ipt_register_table(struct xt_table *table, const struct ipt_replace *repl)
return ret;
}

if (xt_register_table(table, &bootstrap, newinfo) != 0) {
ret = xt_register_table(table, &bootstrap, newinfo);
if (ret != 0) {
xt_free_table_info(newinfo);
return ret;
}
Expand Down
3 changes: 2 additions & 1 deletion net/ipv6/netfilter/ip6_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -1281,7 +1281,8 @@ int ip6t_register_table(struct xt_table *table,
return ret;
}

if (xt_register_table(table, &bootstrap, newinfo) != 0) {
ret = xt_register_table(table, &bootstrap, newinfo);
if (ret != 0) {
xt_free_table_info(newinfo);
return ret;
}
Expand Down

0 comments on commit da298d3

Please sign in to comment.