netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* netfilter 01/01: xt_quota: fix wrong return value (error case)
@ 2009-08-20 12:47 Patrick McHardy
  0 siblings, 0 replies; only message in thread
From: Patrick McHardy @ 2009-08-20 12:47 UTC (permalink / raw)
  To: David S. Miller; +Cc: Netfilter Development Mailinglist, Linux Netdev List

[-- Attachment #1: Type: text/plain, Size: 179 bytes --]

Hi Dave,

the following patch for 2.6.31 fixes a regression in the xt_quota module
introduced in 2.6.30-rc1, causing a crash when memory allocation fails.

Please apply, thanks.


[-- Attachment #2: 01.diff --]
[-- Type: text/x-patch, Size: 865 bytes --]

commit 53fa59e004cd02b1bd97edff965d063222bd0171
Author: Jan Engelhardt <jengelh@medozas.de>
Date:   Thu Aug 13 15:42:17 2009 +0200

    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>

diff --git a/net/netfilter/xt_quota.c b/net/netfilter/xt_quota.c
index 98fc190..390b7d0 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)
 
 	q->master = kmalloc(sizeof(*q->master), GFP_KERNEL);
 	if (q->master == NULL)
-		return -ENOMEM;
+		return false;
 
 	q->master->quota = q->quota;
 	return true;

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-08-20 12:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-20 12:47 netfilter 01/01: xt_quota: fix wrong return value (error case) Patrick McHardy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).