Skip to content

Commit 97103dc

Browse files
ColinIanKingakpm00
authored andcommitted
squashfs: fix incorrect argument to sizeof in kmalloc_array call
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. [akpm@linux-foundation.org: fix build] Link: https://lkml.kernel.org/r/20250708142604.1891156-1-colin.i.king@gmail.com Fixes: 2e227ff ("squashfs: add optional full compressed block caching") Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Cc: Phillip Lougher <phillip@squashfs.org.uk> Cc: Chanho Min <chanho.min@lge.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent c0f98be commit 97103dc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)