From mboxrd@z Thu Jan 1 00:00:00 1970 From: Amy Griffis Subject: [PATCH] fix audit_krule_to_{rule,data} return values Date: Tue, 2 May 2006 15:06:01 -0400 Message-ID: <20060502190601.GA29511@zk3.dec.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mx1.redhat.com (mx1.redhat.com [172.16.48.31]) by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k42J6MTJ001163 for ; Tue, 2 May 2006 15:06:22 -0400 Received: from palrel11.hp.com (palrel11.hp.com [156.153.255.246]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k42J6J3p030704 for ; Tue, 2 May 2006 15:06:19 -0400 Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: linux-audit@redhat.com List-Id: linux-audit@redhat.com Don't return -ENOMEM when callers of these functions are checking for a NULL return. Bug noticed by Serge Hallyn. Signed-off-by: Amy Griffis diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c index 35dca7e..7647237 100644 --- a/kernel/auditfilter.c +++ b/kernel/auditfilter.c @@ -457,7 +457,7 @@ static struct audit_rule *audit_krule_to rule = kmalloc(sizeof(*rule), GFP_KERNEL); if (unlikely(!rule)) - return ERR_PTR(-ENOMEM); + return NULL; memset(rule, 0, sizeof(*rule)); rule->flags = krule->flags | krule->listnr; @@ -488,7 +488,7 @@ static struct audit_rule_data *audit_kru data = kmalloc(sizeof(*data) + krule->buflen, GFP_KERNEL); if (unlikely(!data)) - return ERR_PTR(-ENOMEM); + return NULL; memset(data, 0, sizeof(*data)); data->flags = krule->flags | krule->listnr;