linux/drivers/net/ethernet/intel/e1000
Agalakov Daniil d3baa34a47 e1000: check return value of e1000_read_eeprom
[Why]
e1000_set_eeprom() performs a read-modify-write operation when the write
range is not word-aligned. This requires reading the first and last words
of the range from the EEPROM to preserve the unmodified bytes.

However, the code does not check the return value of e1000_read_eeprom().
If the read fails, the operation continues using uninitialized data from
eeprom_buff. This results in corrupted data being written back to the
EEPROM for the boundary words.

Add the missing error checks and abort the operation if reading fails.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Co-developed-by: Iskhakov Daniil <dish@amicon.ru>
Signed-off-by: Iskhakov Daniil <dish@amicon.ru>
Signed-off-by: Agalakov Daniil <ade@amicon.ru>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2026-04-06 14:13:38 -07:00
..
e1000_ethtool.c e1000: check return value of e1000_read_eeprom 2026-04-06 14:13:38 -07:00
e1000_hw.c e1000: drop unnecessary constant casts to u16 2025-09-03 10:07:27 -07:00
e1000_hw.h net: e1000: Remove unused declarations 2023-08-13 12:28:03 +01:00
e1000_main.c e1000/e1000e: Fix leak in DMA error cleanup 2026-03-10 13:02:54 -07:00
e1000_osdep.h
e1000_param.c intel: remove unused macros 2022-06-30 09:40:55 -07:00
e1000.h e1000: drop unnecessary constant casts to u16 2025-09-03 10:07:27 -07:00
Makefile net: intel: Use *-y instead of *-objs in Makefile 2024-06-10 19:52:44 -07:00