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 11:02:48 +0000 (12:02 +0100)
commit3589522f96e815477ee5f2344f81b91bcad53af2
treeae034c5d9ec2a05a2496623e18b3d6f01c6d2e72
parent56ebfd2b2e784dc76cadc20789eccad2a441239a
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