mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
fs/ntfs3: Check 'folio' pointer for NULL
[ Upstream commit 1cd6c96219c429ebcfa8e79a865277376c563803 ]
It can be NULL if bmap is called.
Fixes: 82cae269cf
("fs/ntfs3: Add initialization of super block")
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
92ce7359f9
commit
6c8054d590
1 changed files with 11 additions and 6 deletions
|
@ -571,13 +571,18 @@ static noinline int ntfs_get_block_vbo(struct inode *inode, u64 vbo,
|
|||
clear_buffer_uptodate(bh);
|
||||
|
||||
if (is_resident(ni)) {
|
||||
ni_lock(ni);
|
||||
err = attr_data_read_resident(ni, &folio->page);
|
||||
ni_unlock(ni);
|
||||
|
||||
if (!err)
|
||||
set_buffer_uptodate(bh);
|
||||
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);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue