summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2015-03-23 22:48:52 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2015-03-23 22:48:52 +0000
commit56aecc7bb4c6be0e10b829c9249284d11f985463 (patch)
tree5880a68f5846623318fd120b167a03899c108ec2 /sys
parentddef5118e2d4748a45d360d7175fb7aea220e385 (diff)
unlock MII on smsc_miibus_writereg error
from Patrick Wildt
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/if_smsc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/usb/if_smsc.c b/sys/dev/usb/if_smsc.c
index bef569124e4..53097e84889 100644
--- a/sys/dev/usb/if_smsc.c
+++ b/sys/dev/usb/if_smsc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_smsc.c,v 1.17 2015/03/23 08:41:52 mpi Exp $ */
+/* $OpenBSD: if_smsc.c,v 1.18 2015/03/23 22:48:51 jsg Exp $ */
/* $FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */
/*-
* Copyright (c) 2012
@@ -278,6 +278,7 @@ smsc_miibus_writereg(struct device *dev, int phy, int reg, int val)
smsc_lock_mii(sc);
if (smsc_wait_for_bits(sc, SMSC_MII_ADDR, SMSC_MII_BUSY) != 0) {
smsc_warn_printf(sc, "MII is busy\n");
+ smsc_unlock_mii(sc);
return;
}