diff options
author | Patrick McHardy <kaber@trash.net> | 2009-08-19 22:47:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-23 22:09:23 -0400 |
commit | 2149f66f49ab07515666127bf5140c5c94677af8 (patch) | |
tree | b013b8f3b4b3aa8e4303df7affac09f6aafe7363 /net | |
parent | ca6982b858e1d08010c1d29d8e8255b2ac2ad70a (diff) |
netfilter: xt_quota: fix wrong return value (error case)
Success was indicated on a memory allocation failure, thereby causing
a crash due to a later NULL deref.
(Affects v2.6.30-rc1 up to here.)
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/xt_quota.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/xt_quota.c b/net/netfilter/xt_quota.c index 98fc190e8f0e..390b7d09fe51 100644 --- a/net/netfilter/xt_quota.c +++ b/net/netfilter/xt_quota.c | |||
@@ -52,7 +52,7 @@ static bool quota_mt_check(const struct xt_mtchk_param *par) | |||
52 | 52 | ||
53 | q->master = kmalloc(sizeof(*q->master), GFP_KERNEL); | 53 | q->master = kmalloc(sizeof(*q->master), GFP_KERNEL); |
54 | if (q->master == NULL) | 54 | if (q->master == NULL) |
55 | return -ENOMEM; | 55 | return false; |
56 | 56 | ||
57 | q->master->quota = q->quota; | 57 | q->master->quota = q->quota; |
58 | return true; | 58 | return true; |