Message ID | 20220420142007.3041173-1-idosch@nvidia.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 869376d0859acf40c83b2c3942ad9d5a8b5d31e4 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] mlxsw: core_linecards: Fix size of array element during ini_files allocation | expand |
Hello: This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <kuba@kernel.org>: On Wed, 20 Apr 2022 17:20:07 +0300 you wrote: > From: Jiri Pirko <jiri@nvidia.com> > > 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. > > [...] 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!
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c b/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c index 90e487cc2e2a..5c9869dcf674 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c @@ -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;