Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Mar 2002 09:31:30 +0100 (CET)
From:      Hartmut Brandt <brandt@fokus.gmd.de>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/36413: the bktr driver tries to destroy device aliases and panics the kernel
Message-ID:  <200203280831.g2S8VUK00451@fokus.gmd.de>

next in thread | raw e-mail | index | archive | help

>Number:         36413
>Category:       kern
>Synopsis:       the bktr driver tries to destroy device aliases and panics the kernel
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 28 00:40:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Hartmut Brandt
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
FhI Fokus
>Environment:
System: FreeBSD beagle.fokus.gmd.de 5.0-CURRENT FreeBSD 5.0-CURRENT #31: Wed Mar 27 14:48:19 CET 2002 hbb@beagle.fokus.gmd.de:/opt/obj/usr/src/sys/BEAGLE i386


	
>Description:

For unit number 0 the bktr driver creates device aliases without the unit
number in the name. When unloaded the driver calls destroy_dev on these aliases,
although make_dev(9) explicitly states, that this should not be done.
Consequently the kernel panics in the devfs code with a 'Don't do that'.

>How-To-Repeat:

kldload bktr
kldunload bktr

>Fix:

Apply the following patch to bktr_os.c

Index: bktr_os.c
===================================================================
RCS file: /usr/ncvs/src/sys/dev/bktr/bktr_os.c,v
retrieving revision 1.24
diff -u -r1.24 bktr_os.c
--- bktr_os.c	4 Nov 2001 11:50:08 -0000	1.24
+++ bktr_os.c	28 Mar 2002 08:27:07 -0000
@@ -481,19 +481,11 @@
 	/* The memory is retained by the bktr_mem module so we can unload and */
 	/* then reload the main bktr driver module */
 
-	/* Unregister the /dev/bktrN, tunerN and vbiN devices */
+	/* Unregister the /dev/bktrN, tunerN and vbiN devices,
+	 * the aliases for unit 0 are automatically destroyed */
 	destroy_dev(bktr->vbidev);
 	destroy_dev(bktr->tunerdev);
 	destroy_dev(bktr->bktrdev);
-
-	/* If this is unit 0, then destroy the alias entries too */
-#if (__FreeBSD_version >=500000)
-	if (unit == 0) {
-	    destroy_dev(bktr->vbidev_alias);
-	    destroy_dev(bktr->tunerdev_alias);
-	    destroy_dev(bktr->bktrdev_alias);
-	}
-#endif
 
 	/*
 	 * Deallocate resources.


>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200203280831.g2S8VUK00451>