Hi,
in the case that reading the MII errors, the lock isn't released. This
means on the next call, the lock will fail and make it panic.
This diff properly unlocks the mii in the error case.
Best regards,
Patrick
diff --git a/sys/dev/usb/if_smsc.c b/sys/dev/usb/if_smsc.c
index 7d99da8..4c2aebe 100644
--- sys/dev/usb/if_smsc.c
+++ sys/dev/usb/if_smsc.c
@@ -261,9 +261,9 @@ smsc_miibus_readreg(struct device *dev, int phy, int reg)
smsc_warn_printf(sc, "MII read timeout\n");
smsc_read_reg(sc, SMSC_MII_DATA, &val);
- smsc_unlock_mii(sc);
-
+
done:
+ smsc_unlock_mii(sc);
return (val & 0xFFFF);
}