net: sfp: add error checking with sfp_irq_name

Add error checking with sfp_irq_name before use.

Signed-off-by: Chris Healy <cphealy@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Chris Healy 2020-07-07 13:32:05 -07:00 committed by David S. Miller
parent 964201de69
commit 8cb601f158

View File

@ -2354,6 +2354,9 @@ static int sfp_probe(struct platform_device *pdev)
"%s-%s", dev_name(sfp->dev), "%s-%s", dev_name(sfp->dev),
gpio_of_names[i]); gpio_of_names[i]);
if (!sfp_irq_name)
return -ENOMEM;
err = devm_request_threaded_irq(sfp->dev, sfp->gpio_irq[i], err = devm_request_threaded_irq(sfp->dev, sfp->gpio_irq[i],
NULL, sfp_irq, NULL, sfp_irq,
IRQF_ONESHOT | IRQF_ONESHOT |