[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Tue, 7 Jul 2020 13:32:05 -0700
From: Chris Healy <cphealy@...il.com>
To: linux@...linux.org.uk, andrew@...n.ch, f.fainelli@...il.com,
hkallweit1@...il.com, davem@...emloft.net, kuba@...nel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Chris Healy <cphealy@...il.com>
Subject: [PATCH net-next] net: sfp: add error checking with sfp_irq_name
Add error checking with sfp_irq_name before use.
Signed-off-by: Chris Healy <cphealy@...il.com>
---
drivers/net/phy/sfp.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index 7bdfcde98266..eef458ab0e5b 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -2354,6 +2354,9 @@ static int sfp_probe(struct platform_device *pdev)
"%s-%s", dev_name(sfp->dev),
gpio_of_names[i]);
+ if (!sfp_irq_name)
+ return -ENOMEM;
+
err = devm_request_threaded_irq(sfp->dev, sfp->gpio_irq[i],
NULL, sfp_irq,
IRQF_ONESHOT |
--
2.21.3
Powered by blists - more mailing lists