在 2026/6/12 16:58, Jagielski, Jedrzej 写道:
> From: Rongguang Wei <[email protected]> 
> Sent: Friday, June 12, 2026 10:04 AM
> 
>> From: Rongguang Wei <[email protected]>
>>
>> The phy_data variable is not initialized. If e1000_read_phy_reg
>> returns an error, phy_data will not point to a valid value from
>> the PHY register, which may cause the regs_buff array to be populated
>> with unexpected values.
> 
> Hi,
> 
> Sounds like a fix, but i believe we would like to have any real
> scenario when the issue occurs and how it can be reproduced.
> If such is provided please target the patch against net tree and
> add fixes tag.
> 
Hi,
I was not face a real scenario. I just found out there is no check for 
e1000_read_phy_reg return value when I reading the driver code. 
Maybe is better to initialized the value or check the return value of 
e1000_read_phy_reg.
>>
>> Signed-off-by: Rongguang Wei <[email protected]>
>> Change-Id: I46071b3b21a566f8da650168d38d6968251b077d
> 
> 
> i doubt this is a correct kernel commit tag
> 
>> ---
>> drivers/net/ethernet/intel/e1000/e1000_ethtool.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/intel/e1000/e1000_ethtool.c 
>> b/drivers/net/ethernet/intel/e1000/e1000_ethtool.c
>> index 4dcbeabb3ad2..f068108c5004 100644
>> --- a/drivers/net/ethernet/intel/e1000/e1000_ethtool.c
>> +++ b/drivers/net/ethernet/intel/e1000/e1000_ethtool.c
>> @@ -327,7 +327,7 @@ static void e1000_get_regs(struct net_device *netdev, 
>> struct ethtool_regs *regs,
>>      struct e1000_adapter *adapter = netdev_priv(netdev);
>>      struct e1000_hw *hw = &adapter->hw;
>>      u32 *regs_buff = p;
>> -    u16 phy_data;
>> +    u16 phy_data = 0;
>>
>>      memset(p, 0, E1000_REGS_LEN * sizeof(u32));
>>
>> -- 
>> 2.25.1
> 

Reply via email to