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 13:10:58 +0000 (14:10 +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 166c3c4..bb7e33c 100644 (file)
@@ -2149,7 +2149,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);