Author: vmikayelyan Date: Fri Aug 19 15:34:48 2016 New Revision: 72368
URL: http://svn.reactos.org/svn/reactos?rev=72368&view=rev Log: usb: hub: PDO: New checking in IsValidPDO()
As child's parent FDO at any moment can receive surprise removal, Before being it should notify it's childs by setting their parents to NULL. So if we see PDO with parent==NULL then we can consider it as physically removed, i.e. invalid.
Modified: branches/GSoC_2016/USB/drivers/usb/usbhub/pdo.c
Modified: branches/GSoC_2016/USB/drivers/usb/usbhub/pdo.c URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2016/USB/drivers/usb/usbhub... ============================================================================== --- branches/GSoC_2016/USB/drivers/usb/usbhub/pdo.c [iso-8859-1] (original) +++ branches/GSoC_2016/USB/drivers/usb/usbhub/pdo.c [iso-8859-1] Fri Aug 19 15:34:48 2016 @@ -146,6 +146,11 @@
ChildDeviceExtension = (PHUB_CHILDDEVICE_EXTENSION)DeviceObject->DeviceExtension; ASSERT(ChildDeviceExtension->Common.IsFDO == FALSE); + + // This can happen when parent device was surprise removed. + if (ChildDeviceExtension->ParentDeviceObject == NULL) + return FALSE; + HubDeviceExtension = (PHUB_DEVICE_EXTENSION)ChildDeviceExtension->ParentDeviceObject->DeviceExtension;
for(Index = 0; Index < USB_MAXCHILDREN; Index++)