Skip to content

Commit

Permalink
apparmor: Fix an error code in aafs_create()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and John Johansen committed Sep 22, 2017
1 parent 86aea56 commit 5d314a8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion security/apparmor/apparmorfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,10 @@ static struct dentry *aafs_create(const char *name, umode_t mode,

inode_lock(dir);
dentry = lookup_one_len(name, parent, strlen(name));
if (IS_ERR(dentry))
if (IS_ERR(dentry)) {
error = PTR_ERR(dentry);
goto fail_lock;
}

if (d_really_is_positive(dentry)) {
error = -EEXIST;
Expand Down

0 comments on commit 5d314a8

Please sign in to comment.