aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorAmy Griffis <amy.griffis@hp.com>2006-05-02 15:06:01 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2006-06-20 05:25:23 -0400
commit0a3b483e83edb6aa6d3c49db70eeb6f1cd9f6c6b (patch)
treed8714c7953e2eb5f1e12243fe8098127b4e7cada /kernel
parent3c66251e573219a0532a5a07381b2f60a412d9eb (diff)
[PATCH] fix audit_krule_to_{rule,data} return values
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> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/auditfilter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index ccfea6d82cc3..b3fccd6808f9 100644
--- a/kernel/auditfilter.c
+++ b/kernel/auditfilter.c
@@ -291,7 +291,7 @@ static struct audit_rule *audit_krule_to_rule(struct audit_krule *krule)
291 291
292 rule = kmalloc(sizeof(*rule), GFP_KERNEL); 292 rule = kmalloc(sizeof(*rule), GFP_KERNEL);
293 if (unlikely(!rule)) 293 if (unlikely(!rule))
294 return ERR_PTR(-ENOMEM); 294 return NULL;
295 memset(rule, 0, sizeof(*rule)); 295 memset(rule, 0, sizeof(*rule));
296 296
297 rule->flags = krule->flags | krule->listnr; 297 rule->flags = krule->flags | krule->listnr;
@@ -322,7 +322,7 @@ static struct audit_rule_data *audit_krule_to_data(struct audit_krule *krule)
322 322
323 data = kmalloc(sizeof(*data) + krule->buflen, GFP_KERNEL); 323 data = kmalloc(sizeof(*data) + krule->buflen, GFP_KERNEL);
324 if (unlikely(!data)) 324 if (unlikely(!data))
325 return ERR_PTR(-ENOMEM); 325 return NULL;
326 memset(data, 0, sizeof(*data)); 326 memset(data, 0, sizeof(*data));
327 327
328 data->flags = krule->flags | krule->listnr; 328 data->flags = krule->flags | krule->listnr;