]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ice: Adjust over allocation of memory in ice_sched_add_root_node() and ice_sched_add_...
authorAleksandr Mishin <amishin@t-argos.ru>
Wed, 10 Jul 2024 12:39:49 +0000 (15:39 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 13:11:24 +0000 (15:11 +0200)
commitd107d63e6635daf8360682e6ef037e73fb2b683b
treea5a3119b9fd59294b0a433fadc5f5c6d92e6cfd7
parent012ae530afa0785102360de452745d33c99a321b
ice: Adjust over allocation of memory in ice_sched_add_root_node() and ice_sched_add_node()

[ Upstream commit 62fdaf9e8056e9a9e6fe63aa9c816ec2122d60c6 ]

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 incorrect types are used as sizeof()
arguments in these calls (structures instead of pointers) which leads to
over allocation of memory.

Adjust over allocation of memory by correcting types in devm_kcalloc()
sizeof() arguments.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/ice/ice_sched.c