* [net] ixgbe: phy: fix uninitialized status in ixgbe_setup_phy_link_tnx
@ 2014-11-11 18:22 Jeff Kirsher
2014-11-11 21:32 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Jeff Kirsher @ 2014-11-11 18:22 UTC (permalink / raw)
To: davem; +Cc: Daniel Borkmann, netdev, nhorman, sassmann, jogreene,
Jeff Kirsher
From: Daniel Borkmann <dborkman@redhat.com>
Status variable is never initialized, can carry an arbitrary value
on the stack and thus may let the function fail.
Fixes: e90dd2645664 ("ixgbe: Make return values more direct")
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Emil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
index d47b19f..28b81ae0 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
@@ -635,7 +635,6 @@ s32 ixgbe_check_phy_link_tnx(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
**/
s32 ixgbe_setup_phy_link_tnx(struct ixgbe_hw *hw)
{
- s32 status;
u16 autoneg_reg = IXGBE_MII_AUTONEG_REG;
bool autoneg = false;
ixgbe_link_speed speed;
@@ -700,8 +699,7 @@ s32 ixgbe_setup_phy_link_tnx(struct ixgbe_hw *hw)
hw->phy.ops.write_reg(hw, MDIO_CTRL1,
MDIO_MMD_AN, autoneg_reg);
-
- return status;
+ return 0;
}
/**
--
1.9.3
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [net] ixgbe: phy: fix uninitialized status in ixgbe_setup_phy_link_tnx
2014-11-11 18:22 [net] ixgbe: phy: fix uninitialized status in ixgbe_setup_phy_link_tnx Jeff Kirsher
@ 2014-11-11 21:32 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-11-11 21:32 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: dborkman, netdev, nhorman, sassmann, jogreene
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 11 Nov 2014 10:22:05 -0800
> From: Daniel Borkmann <dborkman@redhat.com>
>
> Status variable is never initialized, can carry an arbitrary value
> on the stack and thus may let the function fail.
>
> Fixes: e90dd2645664 ("ixgbe: Make return values more direct")
> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
> Acked-by: Emil Tantilov <emil.s.tantilov@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied, thanks Jeff.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-11-11 21:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-11 18:22 [net] ixgbe: phy: fix uninitialized status in ixgbe_setup_phy_link_tnx Jeff Kirsher
2014-11-11 21:32 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox