]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
[PATCH] fix audit_krule_to_{rule,data} return values
authorAmy Griffis <amy.griffis@hp.com>
Tue, 2 May 2006 19:06:01 +0000 (15:06 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 20 Jun 2006 09:25:23 +0000 (05:25 -0400)
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>
kernel/auditfilter.c

index ccfea6d82cc37049c1f15a3d71e48c75da7e5ac9..b3fccd6808f90e00e99b64d25ee82c8ef6e12bd4 100644 (file)
@@ -291,7 +291,7 @@ static struct audit_rule *audit_krule_to_rule(struct audit_krule *krule)
 
        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;
@@ -322,7 +322,7 @@ static struct audit_rule_data *audit_krule_to_data(struct audit_krule *krule)
 
        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;