Skip to contentSkip to conversation

net: sfp: add error checking with sfp_irq_name

PATCH Applied Chris Healy 2 participants 2 messages Jul 7, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: sfp: add error checking with sfp_irq_name

Add error checking with sfp_irq_name before use.

---
 drivers/net/phy/sfp.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/phy/sfp.c +3 -0
index 7bdfcde98266..eef458ab0e5b 100644
@@ -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 |
Signature · 1 line
2.21.3