* [PATCH] fix audit_krule_to_{rule,data} return values
@ 2006-05-02 19:06 Amy Griffis
0 siblings, 0 replies; only message in thread
From: Amy Griffis @ 2006-05-02 19:06 UTC (permalink / raw)
To: linux-audit
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 <amy.griffis@hp.com>
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;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2006-05-02 19:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-02 19:06 [PATCH] fix audit_krule_to_{rule,data} return values Amy Griffis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox