Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/prg-localcount2]: src/sys/dev Don't call device_release() from vnd_detac...



details:   https://anonhg.NetBSD.org/src/rev/9e3966fbf672
branches:  prg-localcount2
changeset: 823520:9e3966fbf672
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Fri Apr 28 23:16:14 2017 +0000

description:
Don't call device_release() from vnd_detach().  The caller (typically,
config_detach()) will take care of this.  Without this fix, we end up
with a negative reference count, and panic.

diffstat:

 sys/dev/vnd.c |  8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diffs (36 lines):

diff -r 6f2d449db850 -r 9e3966fbf672 sys/dev/vnd.c
--- a/sys/dev/vnd.c     Fri Apr 28 06:00:33 2017 +0000
+++ b/sys/dev/vnd.c     Fri Apr 28 23:16:14 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vnd.c,v 1.259.4.2 2017/04/28 06:00:33 pgoyette Exp $   */
+/*     $NetBSD: vnd.c,v 1.259.4.3 2017/04/28 23:16:14 pgoyette Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.259.4.2 2017/04/28 06:00:33 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.259.4.3 2017/04/28 23:16:14 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_vnd.h"
@@ -276,8 +276,7 @@
 }
 
 /*
- * The caller must hold a reference to the device's localcount.  the
- * reference is released if the device is available for detach.
+ * The caller must hold a reference to the device's localcount. 
  */
 static int
 vnd_detach(device_t self, int flags)
@@ -295,7 +294,6 @@
        bufq_free(sc->sc_tab);
        disk_destroy(&sc->sc_dkdev);
 
-       device_release(self);
        return 0;
 }
 



Home | Main Index | Thread Index | Old Index