Message ID | 20231020092430.209765-1-suhui@nfschina.com (mailing list archive) |
---|---|
State | Not Applicable |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | igb: e1000_82575: add an error code check in igb_set_d0_lplu_state_82575 | expand |
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 <suhui@nfschina.com> Reviewed-by: Simon Horman <horms@kernel.org>
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);
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 <suhui@nfschina.com> --- drivers/net/ethernet/intel/igb/e1000_82575.c | 3 +++ 1 file changed, 3 insertions(+)