All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: mdio: Fix ENOMEM return value in BCM6368 mux bus controller
@ 2022-04-28 21:19 Niels Dossche
  2022-04-28 22:56 ` Andrew Lunn
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Niels Dossche @ 2022-04-28 21:19 UTC (permalink / raw)
  To: netdev
  Cc: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Jakub Kicinski, Paolo Abeni, noltari, 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 <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(-)

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;
-- 
2.35.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] net: mdio: Fix ENOMEM return value in BCM6368 mux bus controller
  2022-04-28 21:19 [PATCH] net: mdio: Fix ENOMEM return value in BCM6368 mux bus controller Niels Dossche
@ 2022-04-28 22:56 ` Andrew Lunn
  2022-04-28 23:07   ` Niels Dossche
  2022-04-29 16:04 ` Florian Fainelli
  2022-04-30  1:50 ` patchwork-bot+netdevbpf
  2 siblings, 1 reply; 5+ messages in thread
From: Andrew Lunn @ 2022-04-28 22:56 UTC (permalink / raw)
  To: Niels Dossche
  Cc: netdev, Heiner Kallweit, Russell King, David S. Miller,
	Jakub Kicinski, Paolo Abeni, noltari

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] net: mdio: Fix ENOMEM return value in BCM6368 mux bus controller
  2022-04-28 22:56 ` Andrew Lunn
@ 2022-04-28 23:07   ` Niels Dossche
  0 siblings, 0 replies; 5+ messages in thread
From: Niels Dossche @ 2022-04-28 23:07 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: netdev, Heiner Kallweit, Russell King, David S. Miller,
	Jakub Kicinski, Paolo Abeni, noltari

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] net: mdio: Fix ENOMEM return value in BCM6368 mux bus controller
  2022-04-28 21:19 [PATCH] net: mdio: Fix ENOMEM return value in BCM6368 mux bus controller Niels Dossche
  2022-04-28 22:56 ` Andrew Lunn
@ 2022-04-29 16:04 ` Florian Fainelli
  2022-04-30  1:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 5+ messages in thread
From: Florian Fainelli @ 2022-04-29 16:04 UTC (permalink / raw)
  To: Niels Dossche, netdev
  Cc: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Jakub Kicinski, Paolo Abeni, noltari

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>
-- 
Florian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] net: mdio: Fix ENOMEM return value in BCM6368 mux bus controller
  2022-04-28 21:19 [PATCH] net: mdio: Fix ENOMEM return value in BCM6368 mux bus controller Niels Dossche
  2022-04-28 22:56 ` Andrew Lunn
  2022-04-29 16:04 ` Florian Fainelli
@ 2022-04-30  1:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-04-30  1:50 UTC (permalink / raw)
  To: Niels Dossche
  Cc: netdev, andrew, hkallweit1, linux, davem, kuba, pabeni, noltari

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-04-30  1:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-28 21:19 [PATCH] net: mdio: Fix ENOMEM return value in BCM6368 mux bus controller Niels Dossche
2022-04-28 22:56 ` Andrew Lunn
2022-04-28 23:07   ` Niels Dossche
2022-04-29 16:04 ` Florian Fainelli
2022-04-30  1:50 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.