[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20211224014712.1400623-1-jiasheng@iscas.ac.cn>
Date: Fri, 24 Dec 2021 09:47:12 +0800
From: Jiasheng Jiang <jiasheng@...as.ac.cn>
To: robin.murphy@....com, andy.shevchenko@...il.com,
davem@...emloft.net, kuba@...nel.org, trix@...hat.com,
marex@...x.de
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Jiasheng Jiang <jiasheng@...as.ac.cn>
Subject: [PATCH v3] net: ks8851: Check for error irq
For the possible error irq number returned by the platform_get_irq(),
and it will finally cause the failure of the request_irq().
Consider that platform_get_irq() can now in certain cases return
-EPROBE_DEFER, and the consequences of letting request_irq() effectively
convert that into -EINVAL, even at probe time rather than later on.
So it might be better to check just now.
Fixes: 797047f875b5 ("net: ks8851: Implement Parallel bus operations")
Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
---
Changelog:
v2 -> v3
*Change 1. Using error variable to check.
*Change 2. Refine commit message to be more reasonable.
---
drivers/net/ethernet/micrel/ks8851_par.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/micrel/ks8851_par.c b/drivers/net/ethernet/micrel/ks8851_par.c
index 2e8fcce50f9d..46e1651465a6 100644
--- a/drivers/net/ethernet/micrel/ks8851_par.c
+++ b/drivers/net/ethernet/micrel/ks8851_par.c
@@ -320,7 +320,10 @@ static int ks8851_probe_par(struct platform_device *pdev)
if (ret)
return ret;
- netdev->irq = platform_get_irq(pdev, 0);
+ ret = platform_get_irq(pdev, 0);
+ if (ret < 0)
+ return ret;
+ netdev->irq = ret;
return ks8851_probe_common(netdev, dev, msg_enable);
}
--
2.25.1
Powered by blists - more mailing lists