Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alok Tiwari and committed by
Will Deacon
6ae58c74 ba2ff3e1

+2 -2
+2 -2
drivers/perf/cxl_pmu.c
··· 834 834 if (rc) 835 835 return rc; 836 836 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); 839 839 if (!info->hw_events) 840 840 return -ENOMEM; 841 841