mlxsw: core_linecards: Fix size of array element during ini_files allocation
Subsystems (3)
Ido Schimmel
maintainerPATCH 1/1 mlxsw: core_linecards: Fix size of array element during ini_files allocation
From: Jiri Pirko <[email protected]>
types_info->ini_files is an array of pointers
to struct mlxsw_linecard_ini_file.
Fix the kmalloc_array() argument to be of a size of a pointer.
Addresses-Coverity: ("Incorrect expression (SIZEOF_MISMATCH)")
--- drivers/net/ethernet/mellanox/mlxsw/core_linecards.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlxsw/core_linecards.c +1 -1
@@ -1032,7 +1032,7 @@ static int mlxsw_linecard_types_init(struct mlxsw_core *mlxsw_core, } types_info->ini_files =kmalloc_array (types_info->count, -sizeof (struct mlxsw_linecard_ini_file ), +sizeof (struct mlxsw_linecard_ini_file *),GFP_KERNEL );if (!types_info->ini_files) { err = -ENOMEM ;
Signature · 1 line
2.33.1
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Wed, 20 Apr 2022 17:20:07 +0300 you wrote:
From: Jiri Pirko <[email protected]>
types_info->ini_filesis an array of pointers
to structmlxsw_linecard_ini_file.Fix the
kmalloc_array()argument to be of a size of a pointer.[...]
Here is the summary with links:
- [net-next] mlxsw: core_linecards: Fix size of array element during ini_files allocation
https://git.kernel.org/netdev/net-next/c/869376d0859a
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html