CC: [email protected]
BCC: [email protected]
CC: [email protected]
TO: Jiri Pirko <[email protected]>
CC: Ido Schimmel <[email protected]>

From: kernel test robot <[email protected]>

drivers/net/ethernet/mellanox/mlxsw/core_linecards.c:819: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: 4d458d15b45f ("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://github.com/jpirko/linux_mlxsw combined_queue
head:   a0b1c3a5cea0369e9eeb4307b520ced5440f7b13
commit: 4d458d15b45f6a4fa8d89e0319d4bc3352bd33a0 [33/79] mlxsw: core_linecards: 
Add line card objects and implement provisioning
:::::: branch date: 3 hours ago
:::::: commit date: 10 hours 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
@@ -816,7 +816,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]

Reply via email to