diff options
author | Michael Chan <mchan@broadcom.com> | 2006-04-29 22:00:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-04-29 22:00:24 -0400 |
commit | f6d9a2565bc754043f43b8f51b19f77ee0269411 (patch) | |
tree | 9d99366776a3191b363be38f8e692df405904501 /drivers/net/tg3.c | |
parent | 8e7a22e3eb49042c048f24bab40cf5cf8915487d (diff) |
[TG3]: Fix bug in nvram write
Fix bug in nvram write function. If the starting nvram address offset
happens to be the last dword of the page, the NVRAM_CMD_LAST bit will
not get set in the existing code. This patch fixes the bug by changing
the "else if" to "if" so that the last dword condition always gets
checked.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r-- | drivers/net/tg3.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 97e27d8e5528..07795449709f 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -9404,7 +9404,7 @@ static int tg3_nvram_write_block_buffered(struct tg3 *tp, u32 offset, u32 len, | |||
9404 | 9404 | ||
9405 | if ((page_off == 0) || (i == 0)) | 9405 | if ((page_off == 0) || (i == 0)) |
9406 | nvram_cmd |= NVRAM_CMD_FIRST; | 9406 | nvram_cmd |= NVRAM_CMD_FIRST; |
9407 | else if (page_off == (tp->nvram_pagesize - 4)) | 9407 | if (page_off == (tp->nvram_pagesize - 4)) |
9408 | nvram_cmd |= NVRAM_CMD_LAST; | 9408 | nvram_cmd |= NVRAM_CMD_LAST; |
9409 | 9409 | ||
9410 | if (i == (len - 4)) | 9410 | if (i == (len - 4)) |