public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf/smmuv3: add a check of devm_add_action in smmu_pmu_setup_msi
@ 2023-02-27  3:25 void0red
  2023-03-27 11:26 ` Will Deacon
  0 siblings, 1 reply; 2+ messages in thread
From: void0red @ 2023-02-27  3:25 UTC (permalink / raw)
  To: will; +Cc: mark.rutland, linux-arm-kernel, linux-kernel, Kang Chen

From: Kang Chen <void0red@gmail.com>

devm_add_action may fails, add a warning when it happens.

Signed-off-by: Kang Chen <void0red@gmail.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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-27 11:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-27  3:25 [PATCH] perf/smmuv3: add a check of devm_add_action in smmu_pmu_setup_msi void0red
2023-03-27 11:26 ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox