mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 09:19:51 +00:00
btrfs: fix a memory allocation failure test in btrfs_submit_direct
commit063b1f21cc
upstream. After allocation 'dip' is tested instead of 'dip->csums'. Fix it. Fixes:642c5d34da
("btrfs: allocate the btrfs_dio_private as part of the iomap dio bio") CC: stable@vger.kernel.org # 5.19+ Reviewed-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d8d3545786
commit
120f1b481d
1 changed files with 1 additions and 1 deletions
|
@ -8142,7 +8142,7 @@ static void btrfs_submit_direct(const struct iomap_iter *iter,
|
|||
*/
|
||||
status = BLK_STS_RESOURCE;
|
||||
dip->csums = kcalloc(nr_sectors, fs_info->csum_size, GFP_NOFS);
|
||||
if (!dip)
|
||||
if (!dip->csums)
|
||||
goto out_err;
|
||||
|
||||
status = btrfs_lookup_bio_sums(inode, dio_bio, dip->csums);
|
||||
|
|
Loading…
Reference in a new issue