Re: [PATCH] block: bio-integrity: fix kcalloc() arguments order

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

 



On Tue, Jan 16, 2024 at 05:34:31PM +0300, Dmitry Antipov wrote:
> When compiling with gcc version 14.0.1 20240116 (experimental)
> and W=1, I've noticed the following warning:
> 
> block/bio-integrity.c: In function 'bio_integrity_map_user':
> block/bio-integrity.c:339:38: warning: 'kcalloc' sizes specified with 'sizeof'
> in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
>   339 |                 bvec = kcalloc(sizeof(*bvec), nr_vecs, GFP_KERNEL);
>       |                                      ^
> block/bio-integrity.c:339:38: note: earlier argument should specify number of
> elements, later size of each element
> 
> Since 'n' and 'size' arguments of 'kcalloc()' are multiplied to
> calculate the final size, their actual order doesn't affect the
> result and so this is not a bug. But it's still worth to fix it.
> 
> Fixes: 492c5d455969 ("block: bio-integrity: directly map user buffers")

Looks good.

Reviewed-by: Keith Busch <kbusch@xxxxxxxxxx>




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux