Commit 0a3b483e authored by Amy Griffis's avatar Amy Griffis Committed by Al Viro

[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: default avatarAmy Griffis <amy.griffis@hp.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 3c66251e
...@@ -291,7 +291,7 @@ static struct audit_rule *audit_krule_to_rule(struct audit_krule *krule) ...@@ -291,7 +291,7 @@ static struct audit_rule *audit_krule_to_rule(struct audit_krule *krule)
rule = kmalloc(sizeof(*rule), GFP_KERNEL); rule = kmalloc(sizeof(*rule), GFP_KERNEL);
if (unlikely(!rule)) if (unlikely(!rule))
return ERR_PTR(-ENOMEM); return NULL;
memset(rule, 0, sizeof(*rule)); memset(rule, 0, sizeof(*rule));
rule->flags = krule->flags | krule->listnr; rule->flags = krule->flags | krule->listnr;
...@@ -322,7 +322,7 @@ static struct audit_rule_data *audit_krule_to_data(struct audit_krule *krule) ...@@ -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); data = kmalloc(sizeof(*data) + krule->buflen, GFP_KERNEL);
if (unlikely(!data)) if (unlikely(!data))
return ERR_PTR(-ENOMEM); return NULL;
memset(data, 0, sizeof(*data)); memset(data, 0, sizeof(*data));
data->flags = krule->flags | krule->listnr; data->flags = krule->flags | krule->listnr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment