Attempting to access a device which has been destroyed, such as a UMASS
authorMatthew Dillon <dillon@dragonflybsd.org>
Thu, 13 May 2004 00:23:39 +0000 (00:23 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Thu, 13 May 2004 00:23:39 +0000 (00:23 +0000)
commit217ff971fd549169c58eab4ab46660c2512e5c62
tree71e97f4cca0556c7ab1f16ec21f7d01e994a4ea2
parent81d59d3dea8949c4f842520d2659555dc2fd0bb8
Attempting to access a device which has been destroyed, such as a UMASS
device which has been pulled out and detached from its /dev/daX entry,
panics the system.  This occurs because the device might not be immediately
(or ever) removed from the device hash after the device has been destroyed.
It's fields are cleared, leading to a NULL function call.

Fix the panic by installing a dummy cdevsw when the device is destroyed
rather then NULLing it out.

Reported-by: Sascha Wildner <saw@online.de>
sys/kern/kern_conf.c