]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - 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
CommitLineData
941c5db0
SL
1From 5920eef9d34dbc1812b321eb0d086e32c67fd4ed Mon Sep 17 00:00:00 2001
2From: Ian Kent <raven@themaw.net>
3Date: Fri, 1 Feb 2019 14:21:29 -0800
4Subject: autofs: fix error return in autofs_fill_super()
5
6[ Upstream commit f585b283e3f025754c45bbe7533fc6e5c4643700 ]
7
8In autofs_fill_super() on error of get inode/make root dentry the return
9should be ENOMEM as this is the only failure case of the called
10functions.
11
12Link: http://lkml.kernel.org/r/154725123240.11260.796773942606871359.stgit@pluto-themaw-net
13Signed-off-by: Ian Kent <raven@themaw.net>
14Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
15Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16Signed-off-by: Sasha Levin <sashal@kernel.org>
17---
18 fs/autofs/inode.c | 4 +++-
19 1 file changed, 3 insertions(+), 1 deletion(-)
20
21diff --git a/fs/autofs/inode.c b/fs/autofs/inode.c
22index 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--
382.19.1
39