Skip to content

Commit

Permalink
fou: exit early when parsing config fails
Browse files Browse the repository at this point in the history
Not a big deal, just for corretness.

Cc: Tom Herbert <tom@herbertland.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
WANG Cong authored and David S. Miller committed Apr 13, 2015
1 parent 9272f04 commit 6727063
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/ipv4/fou.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,11 @@ static int fou_nl_cmd_add_port(struct sk_buff *skb, struct genl_info *info)
static int fou_nl_cmd_rm_port(struct sk_buff *skb, struct genl_info *info)
{
struct fou_cfg cfg;
int err;

parse_nl_config(info, &cfg);
err = parse_nl_config(info, &cfg);
if (err)
return err;

return fou_destroy(&init_net, &cfg);
}
Expand Down

0 comments on commit 6727063

Please sign in to comment.