提交 1c6e2493 编写于 作者: S Sergey Shtylyov 提交者: Zheng Zengkai

bcmgenet: add WOL IRQ check

stable inclusion
from stable-v5.10.94
commit 4691c9f047a809693ac4efbc441e29b7dbb0cdca
bugzilla: https://gitee.com/openeuler/kernel/issues/I531X9

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=4691c9f047a809693ac4efbc441e29b7dbb0cdca

--------------------------------

commit 9deb48b5 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: 8562056f ("net: bcmgenet: request Wake-on-LAN interrupt")
Signed-off-by: NSergey Shtylyov <s.shtylyov@omp.ru>
Acked-by: NFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 9fcaa8b1
......@@ -3966,10 +3966,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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册