]> git.pld-linux.org Git - packages/kernel.git/blob - 0004-apparmor-Fix-an-error-code-in-aafs_create.patch
4e937e00c7f76b0d021b8ab8f591d2863e7e9746
[packages/kernel.git] / 0004-apparmor-Fix-an-error-code-in-aafs_create.patch
1 From 8b3851c7b83f32f2be9d4b48371ddf033afedf62 Mon Sep 17 00:00:00 2001
2 From: Dan Carpenter <dan.carpenter@oracle.com>
3 Date: Thu, 13 Jul 2017 10:39:20 +0300
4 Subject: [PATCH 04/17] apparmor: Fix an error code in aafs_create()
5
6 We accidentally forgot to set the error code on this path.  It means we
7 return NULL instead of an error pointer.  I looked through a bunch of
8 callers and I don't think it really causes a big issue, but the
9 documentation says we're supposed to return error pointers here.
10
11 Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
12 Acked-by: Serge Hallyn <serge@hallyn.com>
13 Signed-off-by: John Johansen <john.johansen@canonical.com>
14 (cherry picked from commit aee58bf341db52a3a3563c6b972bfd4fc2d41e46)
15 ---
16  security/apparmor/apparmorfs.c | 4 +++-
17  1 file changed, 3 insertions(+), 1 deletion(-)
18
19 diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
20 index 853c2ec8e0c9..2caeb748070c 100644
21 --- a/security/apparmor/apparmorfs.c
22 +++ b/security/apparmor/apparmorfs.c
23 @@ -248,8 +248,10 @@ static struct dentry *aafs_create(const char *name, umode_t mode,
24  
25         inode_lock(dir);
26         dentry = lookup_one_len(name, parent, strlen(name));
27 -       if (IS_ERR(dentry))
28 +       if (IS_ERR(dentry)) {
29 +               error = PTR_ERR(dentry);
30                 goto fail_lock;
31 +       }
32  
33         if (d_really_is_positive(dentry)) {
34                 error = -EEXIST;
35 -- 
36 2.11.0
37
This page took 0.048872 seconds and 2 git commands to generate.