Re: [PATCH] squashfs: Fix incorrect argument to sizeof in kmalloc_array call

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

 



Le 09/07/2025 à 04:54, Andrew Morton a écrit :
On Wed, 9 Jul 2025 09:05:25 +0800 kernel test robot <lkp@xxxxxxxxx> wrote:

Hi Colin,

kernel test robot noticed the following build errors:

[auto build test ERROR on akpm-mm/mm-everything]
[also build test ERROR on next-20250708]
[cannot apply to linus/master v6.16-rc5]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Colin-Ian-King/squashfs-Fix-incorrect-argument-to-sizeof-in-kmalloc_array-call/20250708-223017
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20250708142604.1891156-1-colin.i.king%40gmail.com
patch subject: [PATCH] squashfs: Fix incorrect argument to sizeof in kmalloc_array call
:::::: branch date: 10 hours ago
:::::: commit date: 10 hours ago
config: mips-randconfig-r071-20250709 (attached as .config)
compiler: mips64-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (attached as reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202507090822.QI1bMiUV-lkp@xxxxxxxxx/

All error/warnings (new ones prefixed by >>):

    In file included from include/linux/percpu.h:5,
                     from include/linux/percpu_counter.h:14,
                     from include/linux/mm_types.h:21,
                     from include/linux/mmzone.h:22,
                     from include/linux/gfp.h:7,
                     from include/linux/xarray.h:16,
                     from include/linux/list_lru.h:14,
                     from include/linux/fs.h:14,
                     from include/linux/highmem.h:5,
                     from include/linux/bvec.h:10,
                     from include/linux/blk_types.h:10,
                     from include/linux/blkdev.h:9,
                     from fs/squashfs/block.c:16:
    fs/squashfs/block.c: In function 'squashfs_bio_read_cached':
fs/squashfs/block.c:92:12: error: 'folio' undeclared (first use in this function)
        sizeof(*folio), GFP_KERNEL | __GFP_ZERO);
                ^~~~~

I made it

	struct folio **cache_folios = kmalloc_array(page_count,
			sizeof(*cache_folios), GFP_KERNEL | __GFP_ZERO);


WHy not kcalloc(), to be less verbose and remove the explicit __GFP_ZERO?

CJ








[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux