summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2013-04-22 18:50:29 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2013-04-22 18:50:29 +0200
commit05d3cc414dbf9657a394738fd5b7cea36f08c8ca (patch)
treed06fe7870e417d3fa51973aa20237c57c1903125
parent44c32071dc8fcf50326b39a25c4ec3e68b458115 (diff)
ether8169: fix deadlock in allocation error case for attach. (thanks erik)
typo in error case, should qunlock() instead of qlock().
-rw-r--r--sys/src/9/pc/ether8169.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/src/9/pc/ether8169.c b/sys/src/9/pc/ether8169.c
index c17d0a51e..6c9a610ec 100644
--- a/sys/src/9/pc/ether8169.c
+++ b/sys/src/9/pc/ether8169.c
@@ -765,11 +765,13 @@ rtl8169attach(Ether* edev)
ctlr->rd = nil;
free(ctlr->dtcc);
ctlr->dtcc = nil;
- qlock(&ctlr->alock);
+ qunlock(&ctlr->alock);
error(Enomem);
}
ctlr->init = 1;
kproc("rtl8169", rtl8169reseter, edev);
+
+ /* rtl8169reseter() does qunlock(&ctlr->alock) when complete */
qlock(&ctlr->alock);
}
qunlock(&ctlr->alock);