linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] net: e1000: do not use uninitalized variable.
@ 2016-07-31  9:30 Heinrich Schuchardt
  2016-08-01  3:45 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Heinrich Schuchardt @ 2016-07-31  9:30 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: intel-wired-lan, netdev, linux-kernel, Heinrich Schuchardt

phy_data has to be set to zero to avoid undefined
behavior.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 drivers/net/ethernet/intel/e1000/e1000_hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/e1000/e1000_hw.c b/drivers/net/ethernet/intel/e1000/e1000_hw.c
index 8172cf0..456bb07 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_hw.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_hw.c
@@ -5390,7 +5390,7 @@ static s32 e1000_set_phy_mode(struct e1000_hw *hw)
 static s32 e1000_set_d3_lplu_state(struct e1000_hw *hw, bool active)
 {
 	s32 ret_val;
-	u16 phy_data;
+	u16 phy_data = 0;
 
 	if (hw->phy_type != e1000_phy_igp)
 		return E1000_SUCCESS;
-- 
2.8.1

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

* Re: [PATCH 1/1] net: e1000: do not use uninitalized variable.
  2016-07-31  9:30 [PATCH 1/1] net: e1000: do not use uninitalized variable Heinrich Schuchardt
@ 2016-08-01  3:45 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-08-01  3:45 UTC (permalink / raw)
  To: xypron.glpk; +Cc: jeffrey.t.kirsher, intel-wired-lan, netdev, linux-kernel

From: Heinrich Schuchardt <xypron.glpk@gmx.de>
Date: Sun, 31 Jul 2016 11:30:58 +0200

> phy_data has to be set to zero to avoid undefined
> behavior.

In your opinion.

phy_data is only used in conditions where it has been initialized
in this function.

Therefore, please read the function carefully instead of just having
knee jerk reactions to whatever the compiler spits out.

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

end of thread, other threads:[~2016-08-01  3:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-31  9:30 [PATCH 1/1] net: e1000: do not use uninitalized variable Heinrich Schuchardt
2016-08-01  3:45 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).