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 09:54:27 +0000 (10:54 +0100)
commit720508dd118d04035875823f44bcd27388ff39b2
tree2e77b61b1e880f3405a08b751e84267d63471fc6
parentf9ed0ea0a9fc59de71b230ff02f59a51fd174ca7
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