File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed 
drivers/net/ethernet/intel/ice Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -3998,6 +3998,8 @@ ice_get_module_eeprom(struct net_device *netdev,
39983998		 * SFP modules only ever use page 0. 
39993999		 */ 
40004000		if  (page  ==  0  ||  !(data [0x2 ] &  0x4 )) {
4001+ 			u32  copy_len ;
4002+ 
40014003			/* If i2c bus is busy due to slow page change or 
40024004			 * link management access, call can fail. This is normal. 
40034005			 * So we retry this a few times. 
@@ -4021,8 +4023,8 @@ ice_get_module_eeprom(struct net_device *netdev,
40214023			}
40224024
40234025			/* Make sure we have enough room for the new block */ 
4024- 			if  (( i   +   SFF_READ_BLOCK_SIZE )  <   ee -> len ) 
4025- 				 memcpy (data  +  i , value , SFF_READ_BLOCK_SIZE );
4026+ 			copy_len   =   min_t ( u32 ,  SFF_READ_BLOCK_SIZE ,  ee -> len   -   i ); 
4027+ 			memcpy (data  +  i , value , copy_len );
40264028		}
40274029	}
40284030	return  0 ;
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments