diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-03-25 06:00:22 -0400 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2010-03-25 06:00:22 -0400 |
commit | 55e0d7cf279177dfe320f54816320558bc370f24 (patch) | |
tree | 6f8c896e95c4a315409fb8053f2ca075b8b72962 /net | |
parent | ef1691504c83ba3eb636c0cfd3ed33f7a6d0b4ee (diff) |
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: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/xt_hashlimit.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index 9e9c48963942..70d561a2d9e0 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c | |||
@@ -879,7 +879,8 @@ static void dl_seq_stop(struct seq_file *s, void *v) | |||
879 | struct xt_hashlimit_htable *htable = s->private; | 879 | struct xt_hashlimit_htable *htable = s->private; |
880 | unsigned int *bucket = (unsigned int *)v; | 880 | unsigned int *bucket = (unsigned int *)v; |
881 | 881 | ||
882 | kfree(bucket); | 882 | if (!IS_ERR(bucket)) |
883 | kfree(bucket); | ||
883 | spin_unlock_bh(&htable->lock); | 884 | spin_unlock_bh(&htable->lock); |
884 | } | 885 | } |
885 | 886 | ||