Commit 55e0d7cf authored by Eric Dumazet's avatar Eric Dumazet Committed by Patrick McHardy

netfilter: xt_hashlimit: dl_seq_stop() fix

If dl_seq_start() memory allocation fails, we crash later in
dl_seq_stop(), trying to kfree(ERR_PTR(-ENOMEM))
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
parent ef169150
...@@ -879,7 +879,8 @@ static void dl_seq_stop(struct seq_file *s, void *v) ...@@ -879,7 +879,8 @@ static void dl_seq_stop(struct seq_file *s, void *v)
struct xt_hashlimit_htable *htable = s->private; struct xt_hashlimit_htable *htable = s->private;
unsigned int *bucket = (unsigned int *)v; unsigned int *bucket = (unsigned int *)v;
kfree(bucket); if (!IS_ERR(bucket))
kfree(bucket);
spin_unlock_bh(&htable->lock); spin_unlock_bh(&htable->lock);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment