[PATCH] mm/shmem: Fix uninitialized variable bug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The "folio" pointer is not initialized on some of the early error
paths.

Fixes: 2b58b3f33ba2 ("mm/shmem: convert shmem_swapin_page() to shmem_swapin_folio()")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
---
This goes through Andrew's tree and will presumably be folded in with
the original patch.

 mm/shmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/shmem.c b/mm/shmem.c
index 107f1e4dd0aa..97f9ea59a7d1 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1681,8 +1681,8 @@ static int shmem_swapin_folio(struct inode *inode, pgoff_t index,
 	struct address_space *mapping = inode->i_mapping;
 	struct shmem_inode_info *info = SHMEM_I(inode);
 	struct mm_struct *charge_mm = vma ? vma->vm_mm : NULL;
+	struct folio *folio = NULL;
 	struct page *page;
-	struct folio *folio;
 	swp_entry_t swap;
 	int error;
 
-- 
2.35.1





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux