提交 1c8594b4 编写于 作者: M Michael Chan 提交者: David S. Miller

[TG3]: Fix bug in tg3_set_eeprom()

Fix a bug in tg3_set_eeprom() when the length is less than 4 and the
offset is not 4-byte aligned.
Signed-off-by: NMichael Chan <mchan@broadcom.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 e6af301b
......@@ -6560,10 +6560,12 @@ static int tg3_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
start = cpu_to_le32(start);
len += b_offset;
offset &= ~3;
if (len < 4)
len = 4;
}
odd_len = 0;
if ((len & 3) && ((len > 4) || (b_offset == 0))) {
if (len & 3) {
/* adjustments to end on required 4 byte boundary */
odd_len = 1;
len = (len + 3) & ~3;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册