ext4: initialize err_blk before calling __ext4_get_inode_loc
authorHarshad Shirwadkar <harshadshirwadkar@gmail.com>
Wed, 1 Dec 2021 16:34:21 +0000 (08:34 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:05:16 +0000 (11:05 +0100)
commit85cc4554eea845ae0a1b06f43df6b566ff6776d2
treed72eaf37a1e3d9dbec02295f96ee9a02d9f5e4d4
parent2d221d9b17fa3065ba7c3afd8ff0a8e1f2818497
ext4: initialize err_blk before calling __ext4_get_inode_loc

commit c27c29c6af4f3f4ce925a2111c256733c5a5b430 upstream.

It is not guaranteed that __ext4_get_inode_loc will definitely set
err_blk pointer when it returns EIO. To avoid using uninitialized
variables, let's first set err_blk to 0.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Link: https://lore.kernel.org/r/20211201163421.2631661-1-harshads@google.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/inode.c