net: mdio: Fix ENOMEM return value in BCM6368 mux bus controller
Subsystems (3)
PATCH 1/1 net: mdio: Fix ENOMEM return value in BCM6368 mux bus controller
Error values inside the probe function must be < 0. The ENOMEM return value has the wrong sign: it is positive instead of negative. Add a minus sign.
---
Note:
I found this issue using my own-developed static analysis tool to find inconsistent error return values. As I do not have the necessary hardware to test, I could not test this patch. I found this issue on v5.17.4. I manually verified the issue report by looking at the code.
drivers/net/mdio/mdio-mux-bcm6368.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/mdio/mdio-mux-bcm6368.c +1 -1
@@ -115,7 +115,7 @@ static int bcm6368_mdiomux_probe(struct platform_device *pdev) md->mii_bus =devm_mdiobus_alloc (&pdev->dev);if (!md->mii_bus) {dev_err (&pdev->dev,"mdiomux bus alloc failed\n" ); -return ENOMEM ; +return -ENOMEM ; } bus = md->mii_bus;
Signature · 1 line
2.35.2
Quoted 6 lines · Niels Dossche
Error values inside the probe function must be < 0. The ENOMEM return value has the wrong sign: it is positive instead of negative. Add a minus sign.
Fixes e239756717b5 ("net: mdio: Add BCM6368 MDIO mux bus controller")Signed-off-by Niels Dossche <[email protected]>
Hi Niels
If you find any more issues like this in the network stack and its drivers, please take a read of
https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html
Andrew
Quoted 8 lines · Andrew Lunn
Quoted 6 lines · Niels Dossche
Error values inside the probe function must be < 0. The ENOMEM return value has the wrong sign: it is positive instead of negative. Add a minus sign.
Fixes e239756717b5 ("net: mdio: Add BCM6368 MDIO mux bus controller")Signed-off-by Niels Dossche <[email protected]>
Quoted 8 lines
Reviewed-by Andrew Lunn <[email protected]>Hi Niels
If you find any more issues like this in the network stack and its drivers, please take a read of
https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html
Hi Andrew
Thanks for the review.
My apologies, I will make sure to correctly tag the tree in the subject in the future.
Kind regards
Niels
Quoted 2 lines
Andrew
Quoted 6 lines · Niels Dossche
Error values inside the probe function must be < 0. The ENOMEM return value has the wrong sign: it is positive instead of negative. Add a minus sign.
Fixes e239756717b5 ("net: mdio: Add BCM6368 MDIO mux bus controller")Signed-off-by Niels Dossche <[email protected]>
Signature · 1 line
Florian
This patch was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Thu, 28 Apr 2022 23:19:32 +0200 you wrote:
Error values inside the probe function must be < 0. The ENOMEM return value has the wrong sign: it is positive instead of negative. Add a minus sign.
Fixes e239756717b5 ("net: mdio: Add BCM6368 MDIO mux bus controller")Signed-off-by Niels Dossche <[email protected]>[...]
Here is the summary with links:
- net: mdio: Fix ENOMEM return value in BCM6368 mux bus controller
https://git.kernel.org/netdev/net/c/e87f66b38e66
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html