When a usb mass storage device is removed the related CAM SIM structure is
authorMatthew Dillon <dillon@dragonflybsd.org>
Sun, 17 Jul 2005 03:49:50 +0000 (03:49 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Sun, 17 Jul 2005 03:49:50 +0000 (03:49 +0000)
commite8876f9e45b3504c258460aa568b0056bed797ef
tree8c6a061b30905f755e55f70fc2b63c73331702a5
parent5c5c2bc7e4d177b8fc6661ce8b3e37dc085e9852
When a usb mass storage device is removed the related CAM SIM structure is
terminated.  A ref count prevents the actual sim structure from being
destroyed if the device still has refs, but the sim->devq structure is not so
protected and will be NULLed out.  An unmount attempt after device removal
will then result in a panic.

Fix this by testing for a NULL sim->devq.

Reported-by: Eduardo Tongson <propolice@gmail.com>
sys/bus/cam/cam_xpt.c