2020-07-07 20:33:26

by Chris Healy

[permalink] [raw]
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 <[email protected]>
---
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


2020-07-07 22:54:19

by David Miller

[permalink] [raw]
Subject: Re: [PATCH net-next] net: sfp: add error checking with sfp_irq_name

From: Chris Healy <[email protected]>
Date: Tue, 7 Jul 2020 13:32:05 -0700

> Add error checking with sfp_irq_name before use.
>
> Signed-off-by: Chris Healy <[email protected]>

Applied.