Message ID | 1543496130-7727-1-git-send-email-hofrat@osadl.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [V2] perf: arm_spe: handle devm_kasprintf() failure | expand |
diff --git a/drivers/perf/arm_spe_pmu.c b/drivers/perf/arm_spe_pmu.c index 54ec278..f1ea00c 100644 --- a/drivers/perf/arm_spe_pmu.c +++ b/drivers/perf/arm_spe_pmu.c @@ -927,6 +927,11 @@ static int arm_spe_pmu_perf_init(struct arm_spe_pmu *spe_pmu) idx = atomic_inc_return(&pmu_idx); name = devm_kasprintf(dev, GFP_KERNEL, "%s_%d", PMUNAME, idx); + if (!name) { + dev_err(dev, "failed to allocate spe_pmu name\n"); + return -ENOMEM; + } + return perf_pmu_register(&spe_pmu->pmu, name, -1); }