Message ID | 20220428211931.8130-1-dossche.niels@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | e87f66b38e66dffdec9daa9f8f0eb044e9a62e3b |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: mdio: Fix ENOMEM return value in BCM6368 mux bus controller | expand |
On Thu, Apr 28, 2022 at 11:19:32PM +0200, Niels Dossche 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 <dossche.niels@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> 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
On 29/04/2022 00:56, Andrew Lunn wrote: > On Thu, Apr 28, 2022 at 11:19:32PM +0200, Niels Dossche 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 <dossche.niels@gmail.com> > > Reviewed-by: Andrew Lunn <andrew@lunn.ch> > > 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 > > Andrew
On 4/28/22 14:19, Niels Dossche 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 <dossche.niels@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Hello: This patch was applied to netdev/net.git (master) by Jakub Kicinski <kuba@kernel.org>: 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 <dossche.niels@gmail.com> > > [...] 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!
diff --git a/drivers/net/mdio/mdio-mux-bcm6368.c b/drivers/net/mdio/mdio-mux-bcm6368.c index 6dcbf987d61b..8b444a8eb6b5 100644 --- a/drivers/net/mdio/mdio-mux-bcm6368.c +++ b/drivers/net/mdio/mdio-mux-bcm6368.c @@ -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;
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 <dossche.niels@gmail.com> --- 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(-)