aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-07-13 03:39:20 -0400
committerJohn Johansen <john.johansen@canonical.com>2017-09-22 16:00:57 -0400
commit5d314a81eca29b01939930c1c596dfa44937e970 (patch)
tree82c7bde1491a5cf98155111da826e073ef276c0e
parent86aea56f14929ff1c05eca1776e9068e907429d5 (diff)
apparmor: Fix an error code in aafs_create()
We accidentally forgot to set the error code on this path. It means we return NULL instead of an error pointer. I looked through a bunch of callers and I don't think it really causes a big issue, but the documentation says we're supposed to return error pointers here. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Serge Hallyn <serge@hallyn.com> Signed-off-by: John Johansen <john.johansen@canonical.com>
-rw-r--r--security/apparmor/apparmorfs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index 853c2ec8e0c9..2caeb748070c 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -248,8 +248,10 @@ static struct dentry *aafs_create(const char *name, umode_t mode,
248 248
249 inode_lock(dir); 249 inode_lock(dir);
250 dentry = lookup_one_len(name, parent, strlen(name)); 250 dentry = lookup_one_len(name, parent, strlen(name));
251 if (IS_ERR(dentry)) 251 if (IS_ERR(dentry)) {
252 error = PTR_ERR(dentry);
252 goto fail_lock; 253 goto fail_lock;
254 }
253 255
254 if (d_really_is_positive(dentry)) { 256 if (d_really_is_positive(dentry)) {
255 error = -EEXIST; 257 error = -EEXIST;