lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240823103938.4fad7ca3@xps-13>
Date: Fri, 23 Aug 2024 10:39:38 +0200
From: Miquel Raynal <miquel.raynal@...tlin.com>
To: Yan Zhen <yanzhen@...o.com>
Cc: vigneshr@...com, richard@....at, linux-mtd@...ts.infradead.org,
 linux-kernel@...r.kernel.org, opensource.kernel@...o.com
Subject: Re: [PATCH v1] mtd:concat:Switch to use kmemdup_array()

Hi Yan,

yanzhen@...o.com wrote on Fri, 23 Aug 2024 16:25:35 +0800:

> When we are allocating an array,
> using kmemdup_array() is more appropriate 
> and makes auditing the code easier.

Why do you cap your lines at the insane limit of 40 chars?

Also you're missing spaces in the title after the ':'

s/Switch to use/Switch to/?

> 
> Signed-off-by: Yan Zhen <yanzhen@...o.com>
> ---
>  drivers/mtd/mtdconcat.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c
> index 193428de6a4b..f56f44aa8625 100644
> --- a/drivers/mtd/mtdconcat.c
> +++ b/drivers/mtd/mtdconcat.c
> @@ -204,7 +204,7 @@ concat_writev(struct mtd_info *mtd, const struct kvec *vecs,
>  	}
>  
>  	/* make a copy of vecs */
> -	vecs_copy = kmemdup(vecs, sizeof(struct kvec) * count, GFP_KERNEL);
> +	vecs_copy = kmemdup_array(vecs, count, sizeof(struct kvec), GFP_KERNEL);
>  	if (!vecs_copy)
>  		return -ENOMEM;
>  

Thanks,
Miquèl

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ