Skip to content

Commit

Permalink
netfilter: CLUSTERIP: clusterip_seq_stop() fix
Browse files Browse the repository at this point in the history
If clusterip_seq_start() memory allocation fails, we crash later in
clusterip_seq_start(), trying to kfree(ERR_PTR(-ENOMEM))

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
  • Loading branch information
Eric Dumazet authored and Patrick McHardy committed Apr 1, 2010
1 parent d26e6a0 commit 902a3dd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/ipv4/netfilter/ipt_CLUSTERIP.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,8 @@ static void *clusterip_seq_next(struct seq_file *s, void *v, loff_t *pos)

static void clusterip_seq_stop(struct seq_file *s, void *v)
{
kfree(v);
if (!IS_ERR(v))
kfree(v);
}

static int clusterip_seq_show(struct seq_file *s, void *v)
Expand Down

0 comments on commit 902a3dd

Please sign in to comment.