lkml.org 
[lkml]   [2024]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] scsi: csiostor: Use kcalloc() instead of kzalloc()
From


On 1/12/24 12:26, Erick Archer wrote:
> Use 2-factor multiplication argument form kcalloc() instead
> of kzalloc().
>
> Link: https://github.com/KSPP/linux/issues/162
> Signed-off-by: Erick Archer <erick.archer@gmx.com>
> ---
> drivers/scsi/csiostor/csio_init.c | 15 +++++----------
> 1 file changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/scsi/csiostor/csio_init.c b/drivers/scsi/csiostor/csio_init.c
> index d649b7a2a879..d72892e44fd1 100644
> --- a/drivers/scsi/csiostor/csio_init.c
> +++ b/drivers/scsi/csiostor/csio_init.c
> @@ -698,8 +698,7 @@ csio_lnodes_block_request(struct csio_hw *hw)
> struct csio_lnode **lnode_list;
> int cur_cnt = 0, ii;
>
> - lnode_list = kzalloc((sizeof(struct csio_lnode *) * hw->num_lns),
> - GFP_KERNEL);
> + lnode_list = kcalloc(hw->num_lns, sizeof(*lnode_list), GFP_KERNEL);

You should also mention and describe these `sizeof` changes in the changelog text.

Thanks
--
Gustavo

\
 
 \ /
  Last update: 2024-01-12 19:48    [W:0.046 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site