Skip to content

Commit

Permalink
[TG3]: Fix bug in nvram write
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Chan authored and David S. Miller committed Apr 30, 2006
1 parent 8e7a22e commit f6d9a25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -9404,7 +9404,7 @@ static int tg3_nvram_write_block_buffered(struct tg3 *tp, u32 offset, u32 len,

if ((page_off == 0) || (i == 0))
nvram_cmd |= NVRAM_CMD_FIRST;
else if (page_off == (tp->nvram_pagesize - 4))
if (page_off == (tp->nvram_pagesize - 4))
nvram_cmd |= NVRAM_CMD_LAST;

if (i == (len - 4))
Expand Down

0 comments on commit f6d9a25

Please sign in to comment.