Netdev List
 help / color / mirror / Atom feed
* [PATCH net] mlxbf_gige: propagate IRQ lookup errors
@ 2026-12-05 11:22 yusuhao
  2026-12-05 11:28 ` netdev-bot+sinfo
  0 siblings, 1 reply; 2+ messages in thread
From: yusuhao @ 2026-12-05 11:22 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	David Thompson, Liming Sun, Asmaa Mnebhi, netdev, yusuhao

From: yusuhao <2025461029@korea.edu>

platform_get_irq() can return an error when an interrupt provider is not
ready. The probe stores all three interrupt lookup results and later
passes them to request_irq(), which hides a negative lookup error as an
invalid IRQ number.

Check each IRQ lookup and return its error before continuing the probe.

An AI coding assistant identified the unchecked returns during source
review and drafted the fix and changelog.

Fixes: f92e1869d74e ("Add Mellanox BlueField Gigabit Ethernet driver")
Cc: stable@vger.kernel.org
Signed-off-by: yusuhao <2025461029@korea.edu>
---
 .../ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
index d1f8a72cae53..fe225b7b3c6d 100644
--- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
@@ -453,8 +453,22 @@ static int mlxbf_gige_probe(struct platform_device *pdev)
 	}
 
 	priv->error_irq = platform_get_irq(pdev, MLXBF_GIGE_ERROR_INTR_IDX);
+	if (priv->error_irq < 0) {
+		err = priv->error_irq;
+		goto out;
+	}
+
 	priv->rx_irq = platform_get_irq(pdev, MLXBF_GIGE_RECEIVE_PKT_INTR_IDX);
+	if (priv->rx_irq < 0) {
+		err = priv->rx_irq;
+		goto out;
+	}
+
 	priv->llu_plu_irq = platform_get_irq(pdev, MLXBF_GIGE_LLU_PLU_INTR_IDX);
+	if (priv->llu_plu_irq < 0) {
+		err = priv->llu_plu_irq;
+		goto out;
+	}
 
 	phy_irq = acpi_dev_gpio_irq_get_by(ACPI_COMPANION(&pdev->dev), "phy", 0);
 	if (phy_irq == -EPROBE_DEFER) {
-- 
2.56.0


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

end of thread, other threads:[~2026-12-05 11:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-05 11:22 [PATCH net] mlxbf_gige: propagate IRQ lookup errors yusuhao
2026-12-05 11:28 ` netdev-bot+sinfo

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