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)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 26 Aug 2024 16:49:57 +0000 (09:49 -0700)
commit62fdaf9e8056e9a9e6fe63aa9c816ec2122d60c6
tree2a0e630a2c2adbbb14340833c30f255e92bdf131
parentb1703d5f794d755e0d4ce1f22eee1215acb8ce02
ice: Adjust over allocation of memory in ice_sched_add_root_node() and ice_sched_add_node()

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>
drivers/net/ethernet/intel/ice/ice_sched.c