summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2019-12-03 05:01:58 +0000
committerriastradh <riastradh@NetBSD.org>2019-12-03 05:01:58 +0000
commit6dfcf035bdec6374f8feab5e171d1a4383687ff2 (patch)
treec06be7d0dfc03777730731215280f7fbdcc849b3 /sys/dev
parent1e5cfeb0c31dff43f5a8918b4e8e2433e24ed19f (diff)
Fix inequality for refcnt drain: -1 here means all refs gone.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/usbnet.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/usb/usbnet.c b/sys/dev/usb/usbnet.c
index 40cbbab8398..6645bd12762 100644
--- a/sys/dev/usb/usbnet.c
+++ b/sys/dev/usb/usbnet.c
@@ -1,4 +1,4 @@
-/* $NetBSD: usbnet.c,v 1.31 2019/12/03 05:01:45 riastradh Exp $ */
+/* $NetBSD: usbnet.c,v 1.32 2019/12/03 05:01:58 riastradh Exp $ */
/*
* Copyright (c) 2019 Matthew R. Green
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.31 2019/12/03 05:01:45 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.32 2019/12/03 05:01:58 riastradh Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -1519,7 +1519,7 @@ usbnet_detach(device_t self, int flags)
mutex_enter(&unp->unp_lock);
unp->unp_refcnt--;
- while (unp->unp_refcnt > 0) {
+ while (unp->unp_refcnt >= 0) {
/* Wait for processes to go away */
cv_wait(&unp->unp_detachcv, &unp->unp_lock);
}