Skip to content

Commit 9deb48b

Browse files
Sergey Shtylyovdavem330
authored andcommitted
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: 8562056 ("net: bcmgenet: request Wake-on-LAN interrupt") Signed-off-by: Sergey Shtylyov <[email protected]> Acked-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent fb80445 commit 9deb48b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/net/ethernet/broadcom/genet/bcmgenet.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4020,10 +4020,12 @@ static int bcmgenet_probe(struct platform_device *pdev)
40204020

40214021
/* Request the WOL interrupt and advertise suspend if available */
40224022
priv->wol_irq_disabled = true;
4023-
err = devm_request_irq(&pdev->dev, priv->wol_irq, bcmgenet_wol_isr, 0,
4024-
dev->name, priv);
4025-
if (!err)
4026-
device_set_wakeup_capable(&pdev->dev, 1);
4023+
if (priv->wol_irq > 0) {
4024+
err = devm_request_irq(&pdev->dev, priv->wol_irq,
4025+
bcmgenet_wol_isr, 0, dev->name, priv);
4026+
if (!err)
4027+
device_set_wakeup_capable(&pdev->dev, 1);
4028+
}
40274029

40284030
/* Set the needed headroom to account for any possible
40294031
* features enabling/disabling at runtime

0 commit comments

Comments
 (0)