From: Michael Chan Date: Sun, 30 Apr 2006 02:00:24 +0000 (-0700) Subject: [TG3]: Fix bug in nvram write X-Git-Tag: v2.6.17-rc4~101^2~1 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=f6d9a2565bc754043f43b8f51b19f77ee0269411;p=linux-2.6-omap-h63xx.git [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 Signed-off-by: David S. Miller --- diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 97e27d8e552..07795449709 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, 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))