[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20211223124930.1400326-1-jiasheng@iscas.ac.cn>
Date: Thu, 23 Dec 2021 20:49:30 +0800
From: Jiasheng Jiang <jiasheng@...as.ac.cn>
To: 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 v2] net: ks8851: Check for error irq
For the possible error irq number returned by the platform_get_irq(), it
should be better to check it in order to prevent the wrong use of error
irq number.
Fixes: 797047f875b5 ("net: ks8851: Implement Parallel bus operations")
Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
---
Changelog:
v1 -> v2
*Change 1. Using error variable to check.
---
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