netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 5/6] tg3: Fix bug in nvram write
@ 2006-04-28 23:36 Michael Chan
  2006-04-30  2:00 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Chan @ 2006-04-28 23:36 UTC (permalink / raw)
  To: davem; +Cc: netdev

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>


diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 97e27d8..0779544 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -9404,7 +9404,7 @@ static int tg3_nvram_write_block_buffere
 
 	        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))



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-04-30  2:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-28 23:36 [PATCH 5/6] tg3: Fix bug in nvram write Michael Chan
2006-04-30  2:00 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).