[usb/usbehci]

- DeviceArrivalWorkItem: Check the device object returned from IoGetAttachedDeviceReference. if its the PDO, deref and return.
- Pass upper attached device object pointer to the completion routine.
- ArrivalNotificationCompletion: Dereference the upper attached device object before returning.

svn path=/trunk/; revision=45023
This commit is contained in:
Michael Martin 2010-01-10 11:08:51 +00:00
parent f579412d32
commit 72ed9b6854

View file

@ -98,7 +98,9 @@ NTSTATUS
NTAPI
ArrivalNotificationCompletion(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID PContext)
{
PDEVICE_OBJECT PortDeviceObject = (PDEVICE_OBJECT) PContext;
IoFreeIrp(Irp);
ObDereferenceObject(PortDeviceObject);
return STATUS_MORE_PROCESSING_REQUIRED;
}
@ -120,6 +122,12 @@ DeviceArrivalWorkItem(PDEVICE_OBJECT DeviceObject, PVOID Context)
return;
}
if (PortDeviceObject == DeviceObject)
{
/* Piontless to send query relations to ourself */
ObDereferenceObject(PortDeviceObject);
}
Irp = IoAllocateIrp(PortDeviceObject->StackSize, FALSE);
if (!Irp)
@ -129,7 +137,7 @@ DeviceArrivalWorkItem(PDEVICE_OBJECT DeviceObject, PVOID Context)
IoSetCompletionRoutine(Irp,
(PIO_COMPLETION_ROUTINE)ArrivalNotificationCompletion,
NULL,
(PVOID) PortDeviceObject,
TRUE,
TRUE,
TRUE);