]> git.baikalelectronics.ru Git - kernel.git/commit
ethtool: prevent endless loop if eeprom size is smaller than announced
authorHeiner Kallweit <hkallweit1@gmail.com>
Mon, 13 Sep 2021 19:58:26 +0000 (21:58 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Sep 2021 13:26:47 +0000 (14:26 +0100)
commit8ac8986d1004fa9ab2c2974c719b4a090f8d712b
tree51388f433d655fbd5996d4b2a550f305cd144300
parent4bb696d04812460c45c4d5849b147215a1101d68
ethtool: prevent endless loop if eeprom size is smaller than announced

It shouldn't happen, but can happen that readable eeprom size is smaller
than announced. Then we would be stuck in an endless loop here because
after reaching the actual end reads return eeprom.len = 0. I faced this
issue when making a mistake in driver development. Detect this scenario
and return an error.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ethtool/ioctl.c