Don't crash during disconnection if a device doesn't have a driver

svn path=/trunk/; revision=23728
This commit is contained in:
Aleksey Bragin
2006-08-26 21:09:11 +00:00
parent f0549011c0
commit 0e407eb6b4
@@ -922,6 +922,14 @@ gendrv_do_disconnect(PUSB_DEV_MANAGER dev_mgr, DEV_HANDLE if_handle, BOOLEAN is_
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;
}