From: Patrick McHardy Date: Thu, 20 Aug 2009 02:47:34 +0000 (+0000) Subject: netfilter: xt_quota: fix wrong return value (error case) X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2149f66f49ab07515666127bf5140c5c94677af8;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Patrick McHardy Signed-off-by: David S. Miller --- 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) q->master = kmalloc(sizeof(*q->master), GFP_KERNEL); if (q->master == NULL) - return -ENOMEM; + return false; q->master->quota = q->quota; return true;