[lvc-project] [PATCH net-next v2] ice: Adjust over allocation of memory in ice_sched_add_root_node() and ice_sched_add_node()

Simon Horman horms at kernel.org
Mon Jul 8 10:29:51 MSK 2024


On Sat, Jul 06, 2024 at 05:05:18PM +0300, Aleksandr Mishin wrote:
> In ice_sched_add_root_node() and ice_sched_add_node() there are calls to
> devm_kcalloc() in order to allocate memory for array of pointers to
> 'ice_sched_node' structure. But in this calls there are 'sizeof(*root)'
> instead of 'sizeof(root)' and 'sizeof(*node)' instead of 'sizeof(node)'.
> So memory is allocated for structures instead pointers. This lead to
> significant over allocation of memory.
> 
> Adjust over allocation of memory by correcting devm_kcalloc() parameters.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Suggested-by: Simon Horman <horms at kernel.org>

FTR, I did provide some review of v1.
But I don't think that counts as suggesting this patch.

> Signed-off-by: Aleksandr Mishin <amishin at t-argos.ru>
> ---
> v2:
>   - Update comment, remove 'Fixes' tag and change the tree from 'net' to
>     'net-next' as suggested by Simon
> 	(https://lore.kernel.org/all/20240706095258.GB1481495@kernel.org/)
> v1: https://lore.kernel.org/all/20240705163620.12429-1-amishin@t-argos.ru/

Also, v2 was sent less than 24h after v1,
please don't do that when posting patches to netdev.

Please do read
https://docs.kernel.org/process/maintainer-netdev.html

...



More information about the lvc-project mailing list