]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tmpfs: fix uninitialized return value in shmem_link
authorDarrick J. Wong <darrick.wong@oracle.com>
Sat, 23 Feb 2019 06:35:32 +0000 (22:35 -0800)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 2 May 2019 20:42:00 +0000 (21:42 +0100)
commit6a0614c5b8951b9e41ffe2d32533a41a472bddb9
tree1f167d5a3ac39361f4e974abafc46e6945416c48
parent2a1a3f84bc27aedda6ae5528b9f2161e0254b245
tmpfs: fix uninitialized return value in shmem_link

commit 29b00e609960ae0fcff382f4c7079dd0874a5311 upstream.

When we made the shmem_reserve_inode call in shmem_link conditional, we
forgot to update the declaration for ret so that it always has a known
value.  Dan Carpenter pointed out this deficiency in the original patch.

Fixes: 1062af920c07 ("tmpfs: fix link accounting when a tmpfile is linked in")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: Matej Kupljen <matej.kupljen@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
mm/shmem.c