[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230227032557.894274-1-void0red@gmail.com>
Date: Mon, 27 Feb 2023 11:25:57 +0800
From: void0red <void0red@...il.com>
To: will@...nel.org
Cc: mark.rutland@....com, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, Kang Chen <void0red@...il.com>
Subject: [PATCH] perf/smmuv3: add a check of devm_add_action in smmu_pmu_setup_msi
From: Kang Chen <void0red@...il.com>
devm_add_action may fails, add a warning when it happens.
Signed-off-by: Kang Chen <void0red@...il.com>
---
drivers/perf/arm_smmuv3_pmu.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/perf/arm_smmuv3_pmu.c b/drivers/perf/arm_smmuv3_pmu.c
index 25a269d43..307bac904 100644
--- a/drivers/perf/arm_smmuv3_pmu.c
+++ b/drivers/perf/arm_smmuv3_pmu.c
@@ -724,7 +724,11 @@ static void smmu_pmu_setup_msi(struct smmu_pmu *pmu)
pmu->irq = msi_get_virq(dev, 0);
/* Add callback to free MSIs on teardown */
- devm_add_action(dev, smmu_pmu_free_msis, dev);
+ ret = devm_add_action(dev, smmu_pmu_free_msis, dev);
+ if (ret) {
+ dev_warn(dev, "failed to add callback to free MSIs on teardown\n");
+ return;
+ }
}
static int smmu_pmu_setup_irq(struct smmu_pmu *pmu)
--
2.34.1
Powered by blists - more mailing lists