Skip to content

Commit

Permalink
netfilter: xt_quota: fix wrong return value (error case)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Aug 24, 2009
1 parent ca6982b commit 2149f66
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/xt_quota.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static bool quota_mt_check(const struct xt_mtchk_param *par)

q->master = kmalloc(sizeof(*q->master), GFP_KERNEL);
if (q->master == NULL)
return -ENOMEM;
return false;

q->master->quota = q->quota;
return true;
Expand Down

0 comments on commit 2149f66

Please sign in to comment.