2023-10-20 09:26:14

by Su Hui

[permalink] [raw]
Subject: [PATCH] igb: e1000_82575: add an error code check in igb_set_d0_lplu_state_82575

igb_set_d0_lplu_state_82575() check all phy->ops.read_reg()'s return value
except this one, just fix this.

Signed-off-by: Su Hui <[email protected]>
---
drivers/net/ethernet/intel/igb/e1000_82575.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c
index 8d6e44ee1895..e765d5ee3661 100644
--- a/drivers/net/ethernet/intel/igb/e1000_82575.c
+++ b/drivers/net/ethernet/intel/igb/e1000_82575.c
@@ -978,6 +978,9 @@ static s32 igb_set_d0_lplu_state_82575(struct e1000_hw *hw, bool active)
/* When LPLU is enabled, we should disable SmartSpeed */
ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG,
&data);
+ if (ret_val)
+ goto out;
+
data &= ~IGP01E1000_PSCFR_SMART_SPEED;
ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG,
data);
--
2.30.2


2023-10-23 16:52:57

by Simon Horman

[permalink] [raw]
Subject: Re: [PATCH] igb: e1000_82575: add an error code check in igb_set_d0_lplu_state_82575

On Fri, Oct 20, 2023 at 05:24:31PM +0800, Su Hui wrote:
> igb_set_d0_lplu_state_82575() check all phy->ops.read_reg()'s return value
> except this one, just fix this.
>
> Signed-off-by: Su Hui <[email protected]>

Reviewed-by: Simon Horman <[email protected]>