Commit 9deb48b5 authored by Sergey Shtylyov's avatar Sergey Shtylyov Committed by David S. Miller

bcmgenet: add WOL IRQ check

The driver neglects to check the result of platform_get_irq_optional()'s
call and blithely passes the negative error codes to devm_request_irq()
(which takes *unsigned* IRQ #), causing it to fail with -EINVAL.
Stop calling devm_request_irq() with the invalid IRQ #s.

Fixes: 8562056f ("net: bcmgenet: request Wake-on-LAN interrupt")
Signed-off-by: default avatarSergey Shtylyov <s.shtylyov@omp.ru>
Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fb80445c
...@@ -4020,10 +4020,12 @@ static int bcmgenet_probe(struct platform_device *pdev) ...@@ -4020,10 +4020,12 @@ static int bcmgenet_probe(struct platform_device *pdev)
/* Request the WOL interrupt and advertise suspend if available */ /* Request the WOL interrupt and advertise suspend if available */
priv->wol_irq_disabled = true; priv->wol_irq_disabled = true;
err = devm_request_irq(&pdev->dev, priv->wol_irq, bcmgenet_wol_isr, 0, if (priv->wol_irq > 0) {
dev->name, priv); err = devm_request_irq(&pdev->dev, priv->wol_irq,
if (!err) bcmgenet_wol_isr, 0, dev->name, priv);
device_set_wakeup_capable(&pdev->dev, 1); if (!err)
device_set_wakeup_capable(&pdev->dev, 1);
}
/* Set the needed headroom to account for any possible /* Set the needed headroom to account for any possible
* features enabling/disabling at runtime * features enabling/disabling at runtime
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment