Skip to content

Commit

Permalink
fs/ntfs3: Fix possible NULL-ptr-deref in ni_readpage_cmpr()
Browse files Browse the repository at this point in the history
[ Upstream commit 32e9212 ]

Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
aalexandrovich authored and gregkh committed Nov 8, 2023
1 parent d408008 commit 3228a2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ntfs3/frecord.c
Original file line number Diff line number Diff line change
Expand Up @@ -2148,7 +2148,7 @@ int ni_readpage_cmpr(struct ntfs_inode *ni, struct page *page)

for (i = 0; i < pages_per_frame; i++) {
pg = pages[i];
if (i == idx)
if (i == idx || !pg)
continue;
unlock_page(pg);
put_page(pg);
Expand Down

0 comments on commit 3228a2e

Please sign in to comment.