From 8cb601f15886f6d05479e46913d954e9ff237312 Mon Sep 17 00:00:00 2001 From: Chris Healy Date: Tue, 7 Jul 2020 13:32:05 -0700 Subject: [PATCH] net: sfp: add error checking with sfp_irq_name Add error checking with sfp_irq_name before use. Signed-off-by: Chris Healy Signed-off-by: David S. Miller --- 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 7bdfcde..eef458a 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.7.4