tree f784f244a3322b25abb7fae02cae7be20a64eb53
parent e6af301be3c129adbc8a7c8ffb76e62533ad9575
author Michael Chan <[EMAIL PROTECTED]> Fri, 22 Apr 2005 07:12:46 -0700
committer David S. Miller <[EMAIL PROTECTED]> Fri, 22 Apr 2005 07:12:46 -0700
[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: Michael Chan <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
net/tg3.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletion(-)
Index: drivers/net/tg3.c
===================================================================
--- 02b2fd5de20468f5966cf3e73fbfa5e6f86baa63/drivers/net/tg3.c (mode:100644
sha1:30154642573644f8c49ca0c39ff7c294f9ec806a)
+++ f784f244a3322b25abb7fae02cae7be20a64eb53/drivers/net/tg3.c (mode:100644
sha1:fb3eb6f8a737db1c1e4d5b3f369dcf0b51433803)
@@ -6560,10 +6560,12 @@ static int tg3_set_eeprom(struct net_dev
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;
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html