In the function ptp_ixp_probe(), when get irq failed
after executing platform_get_irq(), the negative value
returned will not be detected here. So fix error handling
in this place.
Fixes: 9055a2f591629 ("ixp4xx_eth: make ptp support a platform driver")
Signed-off-by: Tang Bin <redacted>
---
drivers/net/ethernet/xscale/ptp_ixp46x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
On Fri, Nov 26, 2021 at 2:10 AM Tang Bin [off-list ref] wrote:
In the function ptp_ixp_probe(), when get irq failed
after executing platform_get_irq(), the negative value
returned will not be detected here. So fix error handling
in this place.
Fixes: 9055a2f591629 ("ixp4xx_eth: make ptp support a platform driver")
Signed-off-by: Tang Bin <redacted>
On Fri, Nov 26, 2021 at 2:10 AM Tang Bin [off-list ref] wrote:
quoted
In the function ptp_ixp_probe(), when get irq failed
after executing platform_get_irq(), the negative value
returned will not be detected here. So fix error handling
in this place.
Fixes: 9055a2f591629 ("ixp4xx_eth: make ptp support a platform driver")
Signed-off-by: Tang Bin <redacted>
Keep disallowing 0. Because that is not a valid IRQ.
... <= 0 ...
Please look at the function platform_get_irq() in the file
drivers/base/platform.c,
the example is :
* int irq = platform_get_irq(pdev, 0);
* if (irq < 0)
* return irq;
Thanks
Tang Bin
On Fri, Nov 26, 2021 at 2:40 AM tangbin [off-list ref] wrote:
On 2021/11/26 9:26, Linus Walleij wrote:
quoted
On Fri, Nov 26, 2021 at 2:10 AM Tang Bin [off-list ref] wrote:
quoted
In the function ptp_ixp_probe(), when get irq failed
after executing platform_get_irq(), the negative value
returned will not be detected here. So fix error handling
in this place.
Fixes: 9055a2f591629 ("ixp4xx_eth: make ptp support a platform driver")
Signed-off-by: Tang Bin <redacted>
Keep disallowing 0. Because that is not a valid IRQ.
... <= 0 ...
Please look at the function platform_get_irq() in the file
drivers/base/platform.c,
the example is :
* int irq = platform_get_irq(pdev, 0);
* if (irq < 0)
* return irq;
In this case, reading the code is a bad idea. IRQ 0 is not valid,
and the fact that platform_get_irq() can return 0 does not make
it valid.
See:
https://lwn.net/Articles/470820/
Yours,
Linus Walleij