]> git.baikalelectronics.ru Git - kernel.git/commit
mv643xx_eth: Fix use of uninitialized port_num field
authorGabriel Paubert <paubert@iram.es>
Fri, 23 Mar 2007 19:03:52 +0000 (12:03 -0700)
committerJeff Garzik <jeff@garzik.org>
Wed, 28 Mar 2007 06:18:51 +0000 (02:18 -0400)
commit0267b58ea927186e3b4e921880e02b6a13880933
tree2d8c5f910214dbb4e911c97ce0f5813f0f5d7ca6
parent7bd953c5d901b594c94c764b0ddf8322bb8c8a52
mv643xx_eth: Fix use of uninitialized port_num field

In this driver, the default ethernet address is first set by by calling
eth_port_uc_addr_get() which reads the relevant registers of the
corresponding port as initially set by firmware. However that function
used the port_num field accessed through the private area of net_dev
before it was set.

The result was that one board I have ended up with the unicast address
set to 00:00:00:00:00:00 (only port 1 is connected on this board). The
problem appeared after commit 2592f97fe65e0fd93ca26d6783cf2f9329ec203b.

This patch fixes the bug by setting mp->port_num prior to calling
eth_port_uc_get_addr().

Signed-off-by: Gabriel Paubert <paubert@iram.es>
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/mv643xx_eth.c