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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <bccf8567-1b5e-497f-9724-e858447216e6@amd.com>
Date: Wed, 21 Feb 2024 16:04:18 -0700
From: Rodrigo Siqueira Jordao <Rodrigo.Siqueira@....com>
To: Lenko Donchev <lenko.donchev@...il.com>
Cc: Harry Wentland <harry.wentland@....com>, Leo Li <sunpeng.li@....com>,
 Alex Deucher <alexander.deucher@....com>,
 Christian König <christian.koenig@....com>,
 "Pan, Xinhui" <Xinhui.Pan@....com>, David Airlie <airlied@...il.com>,
 Daniel Vetter <daniel@...ll.ch>, amd-gfx@...ts.freedesktop.org,
 dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/amd/display: Use kcalloc() instead of kzalloc()



On 1/28/24 02:04, Lenko Donchev wrote:
> We are trying to get rid of all multiplications from allocation
> functions to prevent integer overflows. Here the multiplication is
> obviously safe, but using kcalloc() is more appropriate and improves
> readability. This patch has no effect on runtime behavior.
> 
> Link: https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments
> Link: https://github.com/KSPP/linux/issues/162
> 
> Signed-off-by: Lenko Donchev <lenko.donchev@...il.com>
> ---
>   drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.c
> index 5c9a30211c10..b67cd78e7c58 100644
> --- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.c
> +++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.c
> @@ -164,7 +164,7 @@ static void dpcd_extend_address_range(
>   	if (new_addr_range.start != in_address || new_addr_range.end != end_address) {
>   		*out_address = new_addr_range.start;
>   		*out_size = ADDRESS_RANGE_SIZE(new_addr_range.start, new_addr_range.end);
> -		*out_data = kzalloc(*out_size * sizeof(**out_data), GFP_KERNEL);
> +		*out_data = kcalloc(*out_size, sizeof(**out_data), GFP_KERNEL);
>   	}
>   }
>   

lgtm,

Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@....com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ