* [PATCH] mlxsw: core_linecards: fix badty.cocci warnings
2022-04-19 22:08 [linux-next:master 4374/4662] drivers/net/ethernet/mellanox/mlxsw/core_linecards.c:826:18-48: WARNING: Use correct pointer type argument for sizeof kernel test robot
@ 2022-04-19 22:03 ` kernel test robot
0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2022-04-19 22:03 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 2247 bytes --]
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Jiri Pirko <jiri@nvidia.com>
CC: Ido Schimmel <idosch@nvidia.com>
CC: Petr Machata <petrm@nvidia.com>
CC: Jakub Kicinski <kuba@kernel.org>
CC: Paolo Abeni <pabeni@redhat.com>
CC: netdev(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
From: kernel test robot <lkp@intel.com>
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 <jiri@nvidia.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
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;
^ permalink raw reply [flat|nested] 3+ messages in thread
* [linux-next:master 4374/4662] drivers/net/ethernet/mellanox/mlxsw/core_linecards.c:826:18-48: WARNING: Use correct pointer type argument for sizeof
@ 2022-04-19 22:08 kernel test robot
2022-04-19 22:03 ` [PATCH] mlxsw: core_linecards: fix badty.cocci warnings kernel test robot
0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2022-04-19 22:08 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 1128 bytes --]
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Jiri Pirko <jiri@nvidia.com>
CC: Ido Schimmel <idosch@nvidia.com>
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
config: i386-randconfig-c001 (https://download.01.org/0day-ci/archive/20220420/202204200641.UExpaKGA-lkp(a)intel.com/config)
compiler: gcc-11 (Debian 11.2.0-20) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
cocci warnings: (new ones prefixed by >>)
>> drivers/net/ethernet/mellanox/mlxsw/core_linecards.c:826:18-48: WARNING: Use correct pointer type argument for sizeof
Please review and possibly fold the followup patch.
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] mlxsw: core_linecards: fix badty.cocci warnings
2022-03-13 21:13 [jpirko-mlxsw:combined_queue 33/79] drivers/net/ethernet/mellanox/mlxsw/core_linecards.c:819:18-48: WARNING: Use correct pointer type argument for sizeof kernel test robot
@ 2022-03-13 21:06 ` kernel test robot
0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2022-03-13 21:06 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 2025 bytes --]
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Jiri Pirko <jiri@nvidia.com>
CC: Ido Schimmel <idosch@nvidia.com>
From: kernel test robot <lkp@intel.com>
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 <jiri@nvidia.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
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;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-04-19 22:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-19 22:08 [linux-next:master 4374/4662] drivers/net/ethernet/mellanox/mlxsw/core_linecards.c:826:18-48: WARNING: Use correct pointer type argument for sizeof kernel test robot
2022-04-19 22:03 ` [PATCH] mlxsw: core_linecards: fix badty.cocci warnings kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2022-03-13 21:13 [jpirko-mlxsw:combined_queue 33/79] drivers/net/ethernet/mellanox/mlxsw/core_linecards.c:819:18-48: WARNING: Use correct pointer type argument for sizeof kernel test robot
2022-03-13 21:06 ` [PATCH] mlxsw: core_linecards: fix badty.cocci warnings kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.