Message ID | 20211201163421.2631661-1-harshads@google.com |
---|---|
State | Awaiting Upstream |
Headers | show |
Series | ext4: initialize err_blk before calling __ext4_get_inode_loc | expand |
On Wed, 1 Dec 2021 08:34:21 -0800, Harshad Shirwadkar wrote: > From: Harshad Shirwadkar <harshadshirwadkar@gmail.com> > > 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. > > > [...] Applied, thanks! [1/1] ext4: initialize err_blk before calling __ext4_get_inode_loc commit: 613da7163720054004f596e5f5230753b50a7f45 Best regards,
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index bfd3545f1e5d..fbdd2dda57ae 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4523,7 +4523,7 @@ static int __ext4_get_inode_loc(struct super_block *sb, unsigned long ino, static int __ext4_get_inode_loc_noinmem(struct inode *inode, struct ext4_iloc *iloc) { - ext4_fsblk_t err_blk; + ext4_fsblk_t err_blk = 0; int ret; ret = __ext4_get_inode_loc(inode->i_sb, inode->i_ino, NULL, iloc, @@ -4538,7 +4538,7 @@ static int __ext4_get_inode_loc_noinmem(struct inode *inode, int ext4_get_inode_loc(struct inode *inode, struct ext4_iloc *iloc) { - ext4_fsblk_t err_blk; + ext4_fsblk_t err_blk = 0; int ret; ret = __ext4_get_inode_loc(inode->i_sb, inode->i_ino, inode, iloc,