Author: tfaber Date: Sun May 12 18:24:12 2013 New Revision: 59010
URL: http://svn.reactos.org/svn/reactos?rev=59010&view=rev Log: [HIDUSB] - Plug a memory leak in HidUsb_GetReportDescriptor - Do not try to free in the middle of a pool block on IRP_MN_STOP_DEVICE - Implement HidPower - Do not access an IRP after completing it in HidCreate - Do not waste a stack location in HidSystemControl
Modified: trunk/reactos/drivers/hid/hidusb/hidusb.c
Modified: trunk/reactos/drivers/hid/hidusb/hidusb.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/hid/hidusb/hidusb.c... ============================================================================== --- trunk/reactos/drivers/hid/hidusb/hidusb.c [iso-8859-1] (original) +++ trunk/reactos/drivers/hid/hidusb/hidusb.c [iso-8859-1] Sun May 12 18:24:12 2013 @@ -312,16 +312,16 @@ ASSERT(IoStack->MajorFunction == IRP_MJ_CREATE || IoStack->MajorFunction == IRP_MJ_CLOSE);
// + // informational debug print + // + DPRINT("HIDUSB Request: %x\n", IoStack->MajorFunction); + + // // complete request // Irp->IoStatus.Information = 0; Irp->IoStatus.Status = STATUS_SUCCESS; IoCompleteRequest(Irp, IO_NO_INCREMENT); - - // - // informal debug print - // - DPRINT("HIDUSB Request: %x\n", IoStack->MajorFunction);
// // done @@ -715,6 +715,11 @@ Irp->IoStatus.Information = Length;
// + // free the report buffer + // + ExFreePoolWithTag(Report, HIDUSB_TAG); + + // // done // return Status; @@ -909,9 +914,12 @@ IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { - UNIMPLEMENTED - ASSERT(FALSE); - return STATUS_NOT_IMPLEMENTED; + PHID_DEVICE_EXTENSION DeviceExtension; + + DeviceExtension = DeviceObject->DeviceExtension; + PoStartNextPowerIrp(Irp); + IoSkipCurrentIrpStackLocation(Irp); + return PoCallDriver(DeviceExtension->NextDeviceObject, Irp); }
NTSTATUS @@ -928,9 +936,9 @@ DeviceExtension = DeviceObject->DeviceExtension;
// - // copy stack location - // - IoCopyCurrentIrpStackLocationToNext(Irp); + // skip stack location + // + IoSkipCurrentIrpStackLocation(Irp);
// // submit request @@ -1721,15 +1729,6 @@ }
// - // free resources - // - if (HidDeviceExtension->HidDescriptor) - { - ExFreePoolWithTag(HidDeviceExtension->HidDescriptor, HIDUSB_TAG); - HidDeviceExtension->HidDescriptor = NULL; - } - - // // done // IoCompleteRequest(Irp, IO_NO_INCREMENT);