resend|stable: netfilter: xt_quota: fix wrong return value (error case)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



parent 244e5a09ed31c698654a7f9a2150b4c79efe46fd (v2.6.31-rc1-59-g244e5a0)
commit 8240c9c836726615e9fb164fb7637c0156560b2e
Author: Jan Engelhardt <jengelh@xxxxxxxxxx>
Date:   Wed Jul 22 04:42:09 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@xxxxxxxxxx>
---
 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 ad0ed79..0de9fcf 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;
-- 
# Created with git-export-patch
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux