Skip to content

Commit

Permalink
netfilter: xt_hashlimit: dl_seq_stop() fix
Browse files Browse the repository at this point in the history
If dl_seq_start() memory allocation fails, we crash later in
dl_seq_stop(), 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 kaber committed Mar 25, 2010
1 parent ef16915 commit 55e0d7c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/netfilter/xt_hashlimit.c
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,8 @@ static void dl_seq_stop(struct seq_file *s, void *v)
struct xt_hashlimit_htable *htable = s->private;
unsigned int *bucket = (unsigned int *)v;

kfree(bucket);
if (!IS_ERR(bucket))
kfree(bucket);
spin_unlock_bh(&htable->lock);
}

Expand Down

0 comments on commit 55e0d7c

Please sign in to comment.