mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 23:53:32 +00:00
bcmgenet: add WOL IRQ check
commit9deb48b53e
upstream. 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:8562056f26
("net: bcmgenet: request Wake-on-LAN interrupt") Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
3bd7629eb8
commit
e81d42e544
1 changed files with 6 additions and 4 deletions
|
@ -3507,10 +3507,12 @@ static int bcmgenet_probe(struct platform_device *pdev)
|
|||
|
||||
/* Request the WOL interrupt and advertise suspend if available */
|
||||
priv->wol_irq_disabled = true;
|
||||
err = devm_request_irq(&pdev->dev, priv->wol_irq, bcmgenet_wol_isr, 0,
|
||||
dev->name, priv);
|
||||
if (!err)
|
||||
device_set_wakeup_capable(&pdev->dev, 1);
|
||||
if (priv->wol_irq > 0) {
|
||||
err = devm_request_irq(&pdev->dev, priv->wol_irq,
|
||||
bcmgenet_wol_isr, 0, dev->name, priv);
|
||||
if (!err)
|
||||
device_set_wakeup_capable(&pdev->dev, 1);
|
||||
}
|
||||
|
||||
/* Set the needed headroom to account for any possible
|
||||
* features enabling/disabling at runtime
|
||||
|
|
Loading…
Reference in a new issue