Skip to content

Commit 937385e

Browse files
ColinIanKinggregkh
authored andcommitted
squashfs: fix incorrect argument to sizeof in kmalloc_array call
[ Upstream commit 97103dc ] The sizeof(void *) is the incorrect argument in the kmalloc_array call, it best to fix this by using sizeof(*cache_folios) instead. Fortunately the sizes of void* and folio* happen to be the same, so this has not shown up as a run time issue. [[email protected]: fix build] Link: https://lkml.kernel.org/r/[email protected] Fixes: 2e227ff ("squashfs: add optional full compressed block caching") Signed-off-by: Colin Ian King <[email protected]> Cc: Phillip Lougher <[email protected]> Cc: Chanho Min <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent def5631 commit 937385e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/squashfs/block.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static int squashfs_bio_read_cached(struct bio *fullbio,
8989
int err = 0;
9090
#ifdef CONFIG_SQUASHFS_COMP_CACHE_FULL
9191
struct folio **cache_folios = kmalloc_array(page_count,
92-
sizeof(void *), GFP_KERNEL | __GFP_ZERO);
92+
sizeof(*cache_folios), GFP_KERNEL | __GFP_ZERO);
9393
#endif
9494

9595
bio_for_each_folio_all(fi, fullbio) {

0 commit comments

Comments
 (0)