]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
fs/ntfs3: Fix possible NULL-ptr-deref in ni_readpage_cmpr()
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Tue, 26 Sep 2023 08:19:08 +0000 (11:19 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Nov 2023 16:26:46 +0000 (17:26 +0100)
[ Upstream commit 32e9212256b88f35466642f9c939bb40cfb2c2de ]

Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ntfs3/frecord.c

index 73a56d7ac84b7d08ccd7981eee67346fa3e133ae..b02778cbb1d34ef83bc00df4c1c6d0edd36c397b 100644 (file)
@@ -2100,7 +2100,7 @@ out1:
 
        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);