All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] net: phy: dp83869: fix return of uninitialized variable ret
@ 2019-11-18 11:48 Colin King
  2019-11-18 23:29   ` Andrew Lunn
  2019-11-19  1:23   ` David Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Colin King @ 2019-11-18 11:48 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, Heiner Kallweit, David S . Miller,
	Dan Murphy, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

In the case where the call to phy_interface_is_rgmii returns zero
the variable ret is left uninitialized and this is returned at
the end of the function dp83869_configure_rgmii.  Fix this by
returning 0 instead of the uninitialized value in ret.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: 01db923e8377 ("net: phy: dp83869: Add TI dp83869 phy")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/phy/dp83869.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/dp83869.c b/drivers/net/phy/dp83869.c
index fcd418716c10..1c7a7c57dec3 100644
--- a/drivers/net/phy/dp83869.c
+++ b/drivers/net/phy/dp83869.c
@@ -239,7 +239,7 @@ static int dp83869_configure_rgmii(struct phy_device *phydev,
 			       dp83869->io_impedance &
 			       DP83869_IO_MUX_CFG_IO_IMPEDANCE_CTRL);
 
-	return ret;
+	return 0;
 }
 
 static int dp83869_configure_mode(struct phy_device *phydev,
-- 
2.24.0


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

* Re: [PATCH][next] net: phy: dp83869: fix return of uninitialized variable ret
  2019-11-18 11:48 [PATCH][next] net: phy: dp83869: fix return of uninitialized variable ret Colin King
@ 2019-11-18 23:29   ` Andrew Lunn
  2019-11-19  1:23   ` David Miller
  1 sibling, 0 replies; 7+ messages in thread
From: Andrew Lunn @ 2019-11-18 23:29 UTC (permalink / raw)
  To: Colin King
  Cc: Florian Fainelli, Heiner Kallweit, David S . Miller, Dan Murphy,
	netdev, kernel-janitors, linux-kernel

On Mon, Nov 18, 2019 at 11:48:35AM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> In the case where the call to phy_interface_is_rgmii returns zero
> the variable ret is left uninitialized and this is returned at
> the end of the function dp83869_configure_rgmii.  Fix this by
> returning 0 instead of the uninitialized value in ret.
> 
> Addresses-Coverity: ("Uninitialized scalar variable")
> Fixes: 01db923e8377 ("net: phy: dp83869: Add TI dp83869 phy")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Dan: phy_modify_mmd() could fail. You check the return value for
phy_read and phy_write, so it would be consistent to also check

	 Andrew

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

* Re: [PATCH][next] net: phy: dp83869: fix return of uninitialized variable ret
@ 2019-11-18 23:29   ` Andrew Lunn
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew Lunn @ 2019-11-18 23:29 UTC (permalink / raw)
  To: Colin King
  Cc: Florian Fainelli, Heiner Kallweit, David S . Miller, Dan Murphy,
	netdev, kernel-janitors, linux-kernel

On Mon, Nov 18, 2019 at 11:48:35AM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> In the case where the call to phy_interface_is_rgmii returns zero
> the variable ret is left uninitialized and this is returned at
> the end of the function dp83869_configure_rgmii.  Fix this by
> returning 0 instead of the uninitialized value in ret.
> 
> Addresses-Coverity: ("Uninitialized scalar variable")
> Fixes: 01db923e8377 ("net: phy: dp83869: Add TI dp83869 phy")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Dan: phy_modify_mmd() could fail. You check the return value for
phy_read and phy_write, so it would be consistent to also check

	 Andrew

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

* Re: [PATCH][next] net: phy: dp83869: fix return of uninitialized variable ret
  2019-11-18 11:48 [PATCH][next] net: phy: dp83869: fix return of uninitialized variable ret Colin King
@ 2019-11-19  1:23   ` David Miller
  2019-11-19  1:23   ` David Miller
  1 sibling, 0 replies; 7+ messages in thread
From: David Miller @ 2019-11-19  1:23 UTC (permalink / raw)
  To: colin.king
  Cc: andrew, f.fainelli, hkallweit1, dmurphy, netdev, kernel-janitors,
	linux-kernel

From: Colin King <colin.king@canonical.com>
Date: Mon, 18 Nov 2019 11:48:35 +0000

> From: Colin Ian King <colin.king@canonical.com>
> 
> In the case where the call to phy_interface_is_rgmii returns zero
> the variable ret is left uninitialized and this is returned at
> the end of the function dp83869_configure_rgmii.  Fix this by
> returning 0 instead of the uninitialized value in ret.
> 
> Addresses-Coverity: ("Uninitialized scalar variable")
> Fixes: 01db923e8377 ("net: phy: dp83869: Add TI dp83869 phy")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.

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

* Re: [PATCH][next] net: phy: dp83869: fix return of uninitialized variable ret
@ 2019-11-19  1:23   ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2019-11-19  1:23 UTC (permalink / raw)
  To: colin.king
  Cc: andrew, f.fainelli, hkallweit1, dmurphy, netdev, kernel-janitors,
	linux-kernel

From: Colin King <colin.king@canonical.com>
Date: Mon, 18 Nov 2019 11:48:35 +0000

> From: Colin Ian King <colin.king@canonical.com>
> 
> In the case where the call to phy_interface_is_rgmii returns zero
> the variable ret is left uninitialized and this is returned at
> the end of the function dp83869_configure_rgmii.  Fix this by
> returning 0 instead of the uninitialized value in ret.
> 
> Addresses-Coverity: ("Uninitialized scalar variable")
> Fixes: 01db923e8377 ("net: phy: dp83869: Add TI dp83869 phy")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.

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

* Re: [PATCH][next] net: phy: dp83869: fix return of uninitialized variable ret
  2019-11-18 23:29   ` Andrew Lunn
@ 2019-11-19 17:27     ` Dan Murphy
  -1 siblings, 0 replies; 7+ messages in thread
From: Dan Murphy @ 2019-11-19 17:27 UTC (permalink / raw)
  To: Andrew Lunn, Colin King
  Cc: Florian Fainelli, Heiner Kallweit, David S . Miller, netdev,
	kernel-janitors, linux-kernel

Andrew

On 11/18/19 5:29 PM, Andrew Lunn wrote:
> On Mon, Nov 18, 2019 at 11:48:35AM +0000, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> In the case where the call to phy_interface_is_rgmii returns zero
>> the variable ret is left uninitialized and this is returned at
>> the end of the function dp83869_configure_rgmii.  Fix this by
>> returning 0 instead of the uninitialized value in ret.
>>
>> Addresses-Coverity: ("Uninitialized scalar variable")
>> Fixes: 01db923e8377 ("net: phy: dp83869: Add TI dp83869 phy")
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
>
> Dan: phy_modify_mmd() could fail. You check the return value for
> phy_read and phy_write, so it would be consistent to also check

Thanks for the heads up on this.

I need to check the set/clear_mmd bits too.

Dan


> 	 Andrew

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

* Re: [PATCH][next] net: phy: dp83869: fix return of uninitialized variable ret
@ 2019-11-19 17:27     ` Dan Murphy
  0 siblings, 0 replies; 7+ messages in thread
From: Dan Murphy @ 2019-11-19 17:27 UTC (permalink / raw)
  To: Andrew Lunn, Colin King
  Cc: Florian Fainelli, Heiner Kallweit, David S . Miller, netdev,
	kernel-janitors, linux-kernel

Andrew

On 11/18/19 5:29 PM, Andrew Lunn wrote:
> On Mon, Nov 18, 2019 at 11:48:35AM +0000, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> In the case where the call to phy_interface_is_rgmii returns zero
>> the variable ret is left uninitialized and this is returned at
>> the end of the function dp83869_configure_rgmii.  Fix this by
>> returning 0 instead of the uninitialized value in ret.
>>
>> Addresses-Coverity: ("Uninitialized scalar variable")
>> Fixes: 01db923e8377 ("net: phy: dp83869: Add TI dp83869 phy")
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
>
> Dan: phy_modify_mmd() could fail. You check the return value for
> phy_read and phy_write, so it would be consistent to also check

Thanks for the heads up on this.

I need to check the set/clear_mmd bits too.

Dan


> 	 Andrew

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

end of thread, other threads:[~2019-11-19 17:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-18 11:48 [PATCH][next] net: phy: dp83869: fix return of uninitialized variable ret Colin King
2019-11-18 23:29 ` Andrew Lunn
2019-11-18 23:29   ` Andrew Lunn
2019-11-19 17:27   ` Dan Murphy
2019-11-19 17:27     ` Dan Murphy
2019-11-19  1:23 ` David Miller
2019-11-19  1:23   ` David Miller

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.