ibm_newemac: Fix ZMII refcounting bug
Subsystems (2)
PATCH 3/11 ibm_newemac: Fix ZMII refcounting bug
When using ZMII for MDIO only (such as 440GX with RGMII for data and ZMII for MDIO), the ZMII code would fail to properly refcount, thus triggering a BUG_ON().
Signed-off-by Benjamin Herrenschmidt <[email protected]>
Acked-by Stefan Roese <[email protected]>
---
drivers/net/ibm_newemac/zmii.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ibm_newemac/zmii.c +3 -1
@@ -83,12 +83,14 @@ int __devinit zmii_attach(struct of_deviZMII_DBG (dev,"init(%d, %d)" NL , input, *mode); -if (!zmii_valid_mode (*mode)) +if (!zmii_valid_mode (*mode)) {/* Probably an EMAC connected to RGMII, * but it still may need ZMII for MDIO so * we don't fail here. */ + dev->users++;return 0 ; + }mutex_lock (&dev->lock);