[net-next] net: sfp: add error checking with sfp_irq_name
diff mbox series

Message ID 20200707203205.28592-1-cphealy@gmail.com
State In Next
Commit 8cb601f15886f6d05479e46913d954e9ff237312
Headers show
Series
  • [net-next] net: sfp: add error checking with sfp_irq_name
Related show

Commit Message

Chris Healy July 7, 2020, 8:32 p.m. UTC
Add error checking with sfp_irq_name before use.

Signed-off-by: Chris Healy <cphealy@gmail.com>
---
 drivers/net/phy/sfp.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

David Miller July 7, 2020, 10:51 p.m. UTC | #1
From: Chris Healy <cphealy@gmail.com>
Date: Tue,  7 Jul 2020 13:32:05 -0700

> Add error checking with sfp_irq_name before use.
> 
> Signed-off-by: Chris Healy <cphealy@gmail.com>

Applied.

Patch
diff mbox series

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 |