mirror of
https://github.com/torvalds/linux.git
synced 2026-03-14 03:16:14 +01:00
e1000e: Remove unneeded checks
The caller, ethtool_set_eeprom(), already performs the same checks so
these are unnecessary in the driver. This reverts commit
90fb7db49c ("e1000e: fix heap overflow in e1000_set_eeprom"), however,
corrections for RCT have been kept.
Link: https://lore.kernel.org/all/db92fcc8-114d-4e85-9d15-7860545bc65e@suse.de/
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Link: https://patch.msgid.link/20251125223632.1857532-7-anthony.l.nguyen@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
8dd72ebc73
commit
954ba97cca
1 changed files with 1 additions and 5 deletions
|
|
@ -551,9 +551,9 @@ static int e1000_set_eeprom(struct net_device *netdev,
|
|||
{
|
||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||
struct e1000_hw *hw = &adapter->hw;
|
||||
size_t total_len, max_len;
|
||||
u16 *eeprom_buff;
|
||||
int ret_val = 0;
|
||||
size_t max_len;
|
||||
int first_word;
|
||||
int last_word;
|
||||
void *ptr;
|
||||
|
|
@ -571,10 +571,6 @@ static int e1000_set_eeprom(struct net_device *netdev,
|
|||
|
||||
max_len = hw->nvm.word_size * 2;
|
||||
|
||||
if (check_add_overflow(eeprom->offset, eeprom->len, &total_len) ||
|
||||
total_len > max_len)
|
||||
return -EFBIG;
|
||||
|
||||
first_word = eeprom->offset >> 1;
|
||||
last_word = (eeprom->offset + eeprom->len - 1) >> 1;
|
||||
eeprom_buff = kmalloc(max_len, GFP_KERNEL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue