2023-08-15 07:21:22

by Artem Chernyshev

[permalink] [raw]
Subject: [PATCH] broadcom: b44: Use b44_writephy() return value

Return result of b44_writephy() instead of zero to
deal with possible error.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Artem Chernyshev <[email protected]>
---
drivers/net/ethernet/broadcom/b44.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c
index 392ec09a1d8a..7f94e42ae277 100644
--- a/drivers/net/ethernet/broadcom/b44.c
+++ b/drivers/net/ethernet/broadcom/b44.c
@@ -1793,11 +1793,9 @@ static int b44_nway_reset(struct net_device *dev)
b44_readphy(bp, MII_BMCR, &bmcr);
b44_readphy(bp, MII_BMCR, &bmcr);
r = -EINVAL;
- if (bmcr & BMCR_ANENABLE) {
- b44_writephy(bp, MII_BMCR,
- bmcr | BMCR_ANRESTART);
- r = 0;
- }
+ if (bmcr & BMCR_ANENABLE)
+ r = b44_writephy(bp, MII_BMCR,
+ bmcr | BMCR_ANRESTART);
spin_unlock_irq(&bp->lock);

return r;
--
2.37.3



2023-08-15 15:38:02

by Leon Romanovsky

[permalink] [raw]
Subject: Re: [PATCH] broadcom: b44: Use b44_writephy() return value

On Tue, Aug 15, 2023 at 12:00:30AM +0300, Artem Chernyshev wrote:
> Return result of b44_writephy() instead of zero to
> deal with possible error.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Signed-off-by: Artem Chernyshev <[email protected]>
> ---
> drivers/net/ethernet/broadcom/b44.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>

Thanks,
Reviewed-by: Leon Romanovsky <[email protected]>

2023-08-16 22:41:27

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH] broadcom: b44: Use b44_writephy() return value

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:

On Tue, 15 Aug 2023 00:00:30 +0300 you wrote:
> Return result of b44_writephy() instead of zero to
> deal with possible error.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Signed-off-by: Artem Chernyshev <[email protected]>
>
> [...]

Here is the summary with links:
- broadcom: b44: Use b44_writephy() return value
https://git.kernel.org/netdev/net/c/9944d203fa63

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html