Commit 6ae58c74 authored by Alok Tiwari's avatar Alok Tiwari Committed by Will Deacon
Browse files

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: default avatarAlok Tiwari <alok.a.tiwari@oracle.com>
Reviewed-by: default avatarJonathan Cameron <jonathan.cameron@huawei.com>
Link: https://lore.kernel.org/r/20250624194350.109790-2-alok.a.tiwari@oracle.com


Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent ba2ff3e1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -834,8 +834,8 @@ static int cxl_pmu_probe(struct device *dev)
	if (rc)
		return rc;

	info->hw_events = devm_kcalloc(dev, sizeof(*info->hw_events),
				       info->num_counters, GFP_KERNEL);
	info->hw_events = devm_kcalloc(dev, info->num_counters,
				       sizeof(*info->hw_events), GFP_KERNEL);
	if (!info->hw_events)
		return -ENOMEM;