Unverified Commit 1cd6c962 authored by Konstantin Komarov's avatar Konstantin Komarov
Browse files

fs/ntfs3: Check 'folio' pointer for NULL



It can be NULL if bmap is called.

Fixes: 82cae269 ("fs/ntfs3: Add initialization of super block")
Signed-off-by: default avatarKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
parent b0a5ddee
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -571,13 +571,18 @@ static noinline int ntfs_get_block_vbo(struct inode *inode, u64 vbo,
	clear_buffer_uptodate(bh);

	if (is_resident(ni)) {
		bh->b_blocknr = RESIDENT_LCN;
		bh->b_size = block_size;
		if (!folio) {
			err = 0;
		} else {
			ni_lock(ni);
			err = attr_data_read_resident(ni, &folio->page);
			ni_unlock(ni);

			if (!err)
				set_buffer_uptodate(bh);
		bh->b_size = block_size;
		}
		return err;
	}