]> 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, 10 Oct 2024 10:00:13 +0000 (12:00 +0200)
commitfac02a03836d4bedc1d5f9be24a49e6e444fa83d
tree465e60c3b8dcd07897665b30a70efabaa9dd4538
parentc84a9a85105d86abb2345718d301ee2e8059c30a
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