Skip to content

Commit 5d314a8

Browse files
Dan Carpenterjrjohansen
authored andcommitted
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 <[email protected]> Acked-by: Serge Hallyn <[email protected]> Signed-off-by: John Johansen <[email protected]>
1 parent 86aea56 commit 5d314a8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

security/apparmor/apparmorfs.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,10 @@ static struct dentry *aafs_create(const char *name, umode_t mode,
248248

249249
inode_lock(dir);
250250
dentry = lookup_one_len(name, parent, strlen(name));
251-
if (IS_ERR(dentry))
251+
if (IS_ERR(dentry)) {
252+
error = PTR_ERR(dentry);
252253
goto fail_lock;
254+
}
253255

254256
if (d_really_is_positive(dentry)) {
255257
error = -EEXIST;

0 commit comments

Comments
 (0)