Skip to content

Commit 2a989f2

Browse files
Liu Shixingregkh
authored andcommitted
RDMA/mlx5: Fix type warning of sizeof in __mlx5_ib_alloc_counters()
[ Upstream commit b942fc0 ] sizeof() when applied to a pointer typed expression should give the size of the pointed data, even if the data is a pointer. Fixes: e1f24a7 ("IB/mlx5: Support congestion related counters") Link: https://lore.kernel.org/r/20200917081354.2083293-1-liushixin2@huawei.com Signed-off-by: Liu Shixin <liushixin2@huawei.com> Acked-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent b9616f4 commit 2a989f2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/infiniband/hw/mlx5/counters.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,12 +456,12 @@ static int __mlx5_ib_alloc_counters(struct mlx5_ib_dev *dev,
456456
cnts->num_ext_ppcnt_counters = ARRAY_SIZE(ext_ppcnt_cnts);
457457
num_counters += ARRAY_SIZE(ext_ppcnt_cnts);
458458
}
459-
cnts->names = kcalloc(num_counters, sizeof(cnts->names), GFP_KERNEL);
459+
cnts->names = kcalloc(num_counters, sizeof(*cnts->names), GFP_KERNEL);
460460
if (!cnts->names)
461461
return -ENOMEM;
462462

463463
cnts->offsets = kcalloc(num_counters,
464-
sizeof(cnts->offsets), GFP_KERNEL);
464+
sizeof(*cnts->offsets), GFP_KERNEL);
465465
if (!cnts->offsets)
466466
goto err_names;
467467

0 commit comments

Comments
 (0)