]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
perf/cxlpmu: Fix devm_kcalloc() argument order in cxl_pmu_probe()
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Tue, 24 Jun 2025 19:43:38 +0000 (12:43 -0700)
committerWill Deacon <will@kernel.org>
Mon, 14 Jul 2025 12:36:27 +0000 (13:36 +0100)
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>
drivers/perf/cxl_pmu.c

index d6693519eaee2ee8ef45714c09cb33681478efe9..8998c0a2f3a2dd48d69c50f8f0ef85cf7d4e4145 100644 (file)
@@ -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;