Possible init bug in ibm_newemac/core.c
From: Darcy Watkins <hidden>
Date: 2008-08-15 17:03:07
Hello,
In function...
static int __devinit emac_probe(struct of_device *ofdev,
const struct of_device_id *match)
... in
drivers/net/ibm_newemac/core.c
... there is a chunk of code as follows (The // DLW - BUG ... comment is
mine) ...
/* Find PHY if any */
// DLW - BUG - This uses an uninitialized spinlock (potential badness).
err = emac_init_phy(dev);
if (err != 0)
goto err_detach_tah;
/* Fill in the driver function table */
ndev->open = &emac_open;
if (dev->tah_dev)
ndev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
ndev->tx_timeout = &emac_tx_timeout;
ndev->watchdog_timeo = 5 * HZ;
ndev->stop = &emac_close;
ndev->get_stats = &emac_stats;
ndev->set_multicast_list = &emac_set_multicast_list;
ndev->do_ioctl = &emac_ioctl;
if (emac_phy_supports_gige(dev->phy_mode)) {
ndev->hard_start_xmit = &emac_start_xmit_sg;
ndev->change_mtu = &emac_change_mtu;
dev->commac.ops = &emac_commac_sg_ops;
} else {
ndev->hard_start_xmit = &emac_start_xmit;
}
SET_ETHTOOL_OPS(ndev, &emac_ethtool_ops);