mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-11-01 09:13:37 +00:00 
			
		
		
		
	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: 2e227ff5e2 ("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>
			
			
This commit is contained in:
		
							parent
							
								
									c0f98be69f
								
							
						
					
					
						commit
						97103dcec2
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -89,7 +89,7 @@ static int squashfs_bio_read_cached(struct bio *fullbio,
 | 
			
		|||
	int err = 0;
 | 
			
		||||
#ifdef CONFIG_SQUASHFS_COMP_CACHE_FULL
 | 
			
		||||
	struct folio **cache_folios = kmalloc_array(page_count,
 | 
			
		||||
			sizeof(void *), GFP_KERNEL | __GFP_ZERO);
 | 
			
		||||
			sizeof(*cache_folios), GFP_KERNEL | __GFP_ZERO);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	bio_for_each_folio_all(fi, fullbio) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue