]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.20.16/autofs-fix-error-return-in-autofs_fill_super.patch
Linux 4.20.16
[thirdparty/kernel/stable-queue.git] / releases / 4.20.16 / autofs-fix-error-return-in-autofs_fill_super.patch
1 From 5920eef9d34dbc1812b321eb0d086e32c67fd4ed Mon Sep 17 00:00:00 2001
2 From: Ian Kent <raven@themaw.net>
3 Date: Fri, 1 Feb 2019 14:21:29 -0800
4 Subject: autofs: fix error return in autofs_fill_super()
5
6 [ Upstream commit f585b283e3f025754c45bbe7533fc6e5c4643700 ]
7
8 In autofs_fill_super() on error of get inode/make root dentry the return
9 should be ENOMEM as this is the only failure case of the called
10 functions.
11
12 Link: http://lkml.kernel.org/r/154725123240.11260.796773942606871359.stgit@pluto-themaw-net
13 Signed-off-by: Ian Kent <raven@themaw.net>
14 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
15 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 Signed-off-by: Sasha Levin <sashal@kernel.org>
17 ---
18 fs/autofs/inode.c | 4 +++-
19 1 file changed, 3 insertions(+), 1 deletion(-)
20
21 diff --git a/fs/autofs/inode.c b/fs/autofs/inode.c
22 index 846c052569dd..3c14a8e45ffb 100644
23 --- a/fs/autofs/inode.c
24 +++ b/fs/autofs/inode.c
25 @@ -255,8 +255,10 @@ int autofs_fill_super(struct super_block *s, void *data, int silent)
26 }
27 root_inode = autofs_get_inode(s, S_IFDIR | 0755);
28 root = d_make_root(root_inode);
29 - if (!root)
30 + if (!root) {
31 + ret = -ENOMEM;
32 goto fail_ino;
33 + }
34 pipe = NULL;
35
36 root->d_fsdata = ino;
37 --
38 2.19.1
39