[PATCH] filemap: Fix error propagation in do_read_cache_page()

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

 



When do_read_cache_folio() returns an error pointer the code
was dereferencing it rather than forwarding the error via
ERR_CAST().

Found during code review.

Fixes: 539a3322f208 ("filemap: Add read_cache_folio and read_mapping_folio")
Signed-off-by: Alexander Larsson <alexl@xxxxxxxxxx>
---
 mm/filemap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/filemap.c b/mm/filemap.c
index 15800334147b..6bc55506f7a8 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -3560,7 +3560,7 @@ static struct page *do_read_cache_page(struct address_space *mapping,
 
 	folio = do_read_cache_folio(mapping, index, filler, file, gfp);
 	if (IS_ERR(folio))
-		return &folio->page;
+		return ERR_CAST(folio);
 	return folio_file_page(folio, index);
 }
 
-- 
2.37.3




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux