mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] rpmsg: glink: smem: preserve IRQ acquisition errors
@ 2026-10-13 12:43 Avi Weiss
  2026-10-13 15:04 ` Konrad Dybcio
  0 siblings, 1 reply; 2+ messages in thread
From: Avi Weiss @ 2026-10-13 12:43 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Mathieu Poirier, Sricharan Ramabadhran, Arun Kumar Neelakantam,
	linux-remoteproc, linux-arm-msm, linux-kernel, Avi Weiss

qcom_glink_smem_register() passes the result of of_irq_get() directly
to devm_request_irq(). Negative errors are converted to unsigned IRQ
numbers, causing the IRQ request to return -EINVAL instead of the
original error.

Check the IRQ before requesting it. Preserve negative errors and
return -EINVAL if the IRQ mapping fails.

Fixes: caf989c350e8e ("rpmsg: glink: Introduce glink smem based transport")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
---
A dev_err_probe() diagnostic can be added for IRQ acquisition failures
if preferred.

 drivers/rpmsg/qcom_glink_smem.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/rpmsg/qcom_glink_smem.c b/drivers/rpmsg/qcom_glink_smem.c
index 35bb03e67ae8..010a7da64906 100644
--- a/drivers/rpmsg/qcom_glink_smem.c
+++ b/drivers/rpmsg/qcom_glink_smem.c
@@ -312,6 +312,11 @@ struct qcom_glink_smem *qcom_glink_smem_register(struct device *parent,
 	}
 
 	smem->irq = of_irq_get(smem->dev.of_node, 0);
+	if (smem->irq <= 0) {
+		ret = smem->irq ?: -EINVAL;
+		goto err_put_dev;
+	}
+
 	ret = devm_request_irq(&smem->dev, smem->irq, qcom_glink_smem_intr,
 			       IRQF_NO_SUSPEND | IRQF_NO_AUTOEN,
 			       "glink-smem", smem);

base-commit: 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907
-- 
2.43.0


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

end of thread, other threads:[~2026-10-13 15:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-13 12:43 [PATCH] rpmsg: glink: smem: preserve IRQ acquisition errors Avi Weiss
2026-10-13 15:04 ` Konrad Dybcio

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

all inboxes | Powered by JetHome®