]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.14/tmpfs-fix-uninitialized-return-value-in-shmem_link.patch
drop some duplicated patches that somehow got merged.
[thirdparty/kernel/stable-queue.git] / queue-4.14 / tmpfs-fix-uninitialized-return-value-in-shmem_link.patch
1 From bc0038e0376cf21b44d311d321d327ea3092703e Mon Sep 17 00:00:00 2001
2 From: "Darrick J. Wong" <darrick.wong@oracle.com>
3 Date: Fri, 22 Feb 2019 22:35:32 -0800
4 Subject: tmpfs: fix uninitialized return value in shmem_link
5
6 [ Upstream commit 29b00e609960ae0fcff382f4c7079dd0874a5311 ]
7
8 When we made the shmem_reserve_inode call in shmem_link conditional, we
9 forgot to update the declaration for ret so that it always has a known
10 value. Dan Carpenter pointed out this deficiency in the original patch.
11
12 Fixes: 1062af920c07 ("tmpfs: fix link accounting when a tmpfile is linked in")
13 Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
14 Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
15 Signed-off-by: Hugh Dickins <hughd@google.com>
16 Cc: Matej Kupljen <matej.kupljen@gmail.com>
17 Cc: Al Viro <viro@zeniv.linux.org.uk>
18 Cc: Andrew Morton <akpm@linux-foundation.org>
19 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
20 Signed-off-by: Sasha Levin <sashal@kernel.org>
21 ---
22 mm/shmem.c | 2 +-
23 1 file changed, 1 insertion(+), 1 deletion(-)
24
25 diff --git a/mm/shmem.c b/mm/shmem.c
26 index 9b78c04f532b..037e2ee9ccac 100644
27 --- a/mm/shmem.c
28 +++ b/mm/shmem.c
29 @@ -3096,7 +3096,7 @@ static int shmem_create(struct inode *dir, struct dentry *dentry, umode_t mode,
30 static int shmem_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
31 {
32 struct inode *inode = d_inode(old_dentry);
33 - int ret;
34 + int ret = 0;
35
36 /*
37 * No ordinary (disk based) filesystem counts links as inodes;
38 --
39 2.19.1
40