Skip to content

Commit 6ae58c7

Browse files
aloktiwawilldeacon
authored andcommitted
perf/cxlpmu: Fix devm_kcalloc() argument order in cxl_pmu_probe()
The previous code mistakenly swapped the count and size parameters. This fix corrects the argument order in devm_kcalloc() to follow the conventional count, size form, avoiding potential confusion or bugs. Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Link: https://lore.kernel.org/r/20250624194350.109790-2-alok.a.tiwari@oracle.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent ba2ff3e commit 6ae58c7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/perf/cxl_pmu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -834,8 +834,8 @@ static int cxl_pmu_probe(struct device *dev)
834834
if (rc)
835835
return rc;
836836

837-
info->hw_events = devm_kcalloc(dev, sizeof(*info->hw_events),
838-
info->num_counters, GFP_KERNEL);
837+
info->hw_events = devm_kcalloc(dev, info->num_counters,
838+
sizeof(*info->hw_events), GFP_KERNEL);
839839
if (!info->hw_events)
840840
return -ENOMEM;
841841

0 commit comments

Comments
 (0)