* [PATCH net-next] mlxsw: core_linecards: Fix size of array element during ini_files allocation
@ 2022-04-20 14:20 Ido Schimmel
2022-04-22 22:50 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Ido Schimmel @ 2022-04-20 14:20 UTC (permalink / raw)
To: netdev; +Cc: davem, kuba, pabeni, petrm, jiri, mlxsw, Ido Schimmel
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.
Addresses-Coverity: ("Incorrect expression (SIZEOF_MISMATCH)")
Fixes: b217127e5e4e ("mlxsw: core_linecards: Add line card objects and implement provisioning")
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
drivers/net/ethernet/mellanox/mlxsw/core_linecards.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
--
2.33.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] mlxsw: core_linecards: Fix size of array element during ini_files allocation
2022-04-20 14:20 [PATCH net-next] mlxsw: core_linecards: Fix size of array element during ini_files allocation Ido Schimmel
@ 2022-04-22 22:50 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-04-22 22:50 UTC (permalink / raw)
To: Ido Schimmel; +Cc: netdev, davem, kuba, pabeni, petrm, jiri, mlxsw
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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-22 23:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-20 14:20 [PATCH net-next] mlxsw: core_linecards: Fix size of array element during ini_files allocation Ido Schimmel
2022-04-22 22:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).