Commit 869376d0 authored by Jiri Pirko's avatar Jiri Pirko Committed by Jakub Kicinski

mlxsw: core_linecards: Fix size of array element during ini_files allocation

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)")
Fixes: b217127e ("mlxsw: core_linecards: Add line card objects and implement provisioning")
Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Link: https://lore.kernel.org/r/20220420142007.3041173-1-idosch@nvidia.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 5e726071
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment