Skip to content

Commit

Permalink
[PATCH] fix audit_krule_to_{rule,data} return values
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Amy Griffis authored and Al Viro committed Jun 20, 2006
1 parent 3c66251 commit 0a3b483
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/auditfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0a3b483

Please sign in to comment.