CC: [email protected] BCC: [email protected] CC: Linux Memory Management List <[email protected]> TO: Jiri Pirko <[email protected]> CC: Ido Schimmel <[email protected]> CC: Petr Machata <[email protected]> CC: Jakub Kicinski <[email protected]> CC: Paolo Abeni <[email protected]> CC: [email protected] CC: [email protected]
From: kernel test robot <[email protected]> drivers/net/ethernet/mellanox/mlxsw/core_linecards.c:826:18-48: WARNING: Use correct pointer type argument for sizeof Correct the size argument to alloc functions Semantic patch information: This makes an effort to find cases where the argument to sizeof is wrong in memory allocation functions by checking the type of the allocated memory when it is a double pointer and ensuring the sizeof argument takes a pointer to the the memory being allocated. There are false positives in cases the sizeof argument is not used in constructing the return value. The result may need some reformatting. Generated by: scripts/coccinelle/misc/badty.cocci Fixes: b217127e5e4e ("mlxsw: core_linecards: Add line card objects and implement provisioning") CC: Jiri Pirko <[email protected]> Reported-by: kernel test robot <[email protected]> Signed-off-by: kernel test robot <[email protected]> --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 634de1db0e9bbeb90d7b01020e59ec3dab4d38a1 commit: b217127e5e4ee0ecfce7c5f84cfe082238123bda [4374/4662] mlxsw: core_linecards: Add line card objects and implement provisioning :::::: branch date: 15 hours ago :::::: commit date: 2 days ago Please take the patch only if it's a positive warning. Thanks! drivers/net/ethernet/mellanox/mlxsw/core_linecards.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c @@ -823,7 +823,7 @@ static int mlxsw_linecard_types_init(str } types_info->ini_files = kmalloc_array(types_info->count, - sizeof(struct mlxsw_linecard_ini_file), + sizeof(*types_info->ini_files), GFP_KERNEL); if (!types_info->ini_files) { err = -ENOMEM; _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
