Author: fireball Date: Sun Aug 27 01:09:11 2006 New Revision: 23728
URL: http://svn.reactos.org/svn/reactos?rev=23728&view=rev Log: Don't crash during disconnection if a device doesn't have a driver
Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/gendrv.c
Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/gendrv.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbdr... ============================================================================== --- trunk/reactos/drivers/usb/nt4compat/usbdriver/gendrv.c (original) +++ trunk/reactos/drivers/usb/nt4compat/usbdriver/gendrv.c Sun Aug 27 01:09:11 2006 @@ -922,6 +922,14 @@ pdrvr = pdev->dev_driver; dev_obj = pdev->dev_obj; } + + if (dev_obj == NULL) + { + // it means no driver was found for the device and thus no device object created + // we just do nothing here + return TRUE; + } + pdrvr_ext = (PGENDRV_DRVR_EXTENSION) pdrvr->driver_ext; pdev_ext = (PGENDRV_DEVICE_EXTENSION) dev_obj->DeviceExtension; }