blob: 001af0d21e99252261f2ffdba216a2a9a391ce5c [file] [log] [blame]
From: Dan Carpenter <dan.carpenter@linaro.org>
Subject: fs/proc/task_mmu: fix uninitialized variable in pagemap_pmd_range()
Date: Thu, 13 Jun 2024 17:34:33 +0300
The "folio" pointer is tested for NULL, but it's either valid or
uninitialized. Initialize it to NULL.
Link: https://lkml.kernel.org/r/9d6eaba7-92f8-4a70-8765-38a519680a87@moroto.mountain
Fixes: 84f57f8b8914 ("fs/proc: move page_mapcount() to fs/proc/internal.h")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
fs/proc/task_mmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/proc/task_mmu.c~fs-proc-move-page_mapcount-to-fs-proc-internalh-fix
+++ a/fs/proc/task_mmu.c
@@ -1495,7 +1495,7 @@ static int pagemap_pmd_range(pmd_t *pmdp
u64 flags = 0, frame = 0;
pmd_t pmd = *pmdp;
struct page *page = NULL;
- struct folio *folio;
+ struct folio *folio = NULL;
if (vma->vm_flags & VM_SOFTDIRTY)
flags |= PM_SOFT_DIRTY;
_