mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[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 svn path=/trunk/; revision=59010
This commit is contained in:
parent
a5852729fa
commit
ab06a44464
1 changed files with 18 additions and 19 deletions
|
@ -311,6 +311,11 @@ HidCreate(
|
|||
//
|
||||
ASSERT(IoStack->MajorFunction == IRP_MJ_CREATE || IoStack->MajorFunction == IRP_MJ_CLOSE);
|
||||
|
||||
//
|
||||
// informational debug print
|
||||
//
|
||||
DPRINT("HIDUSB Request: %x\n", IoStack->MajorFunction);
|
||||
|
||||
//
|
||||
// complete request
|
||||
//
|
||||
|
@ -318,11 +323,6 @@ HidCreate(
|
|||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
|
||||
//
|
||||
// informal debug print
|
||||
//
|
||||
DPRINT("HIDUSB Request: %x\n", IoStack->MajorFunction);
|
||||
|
||||
//
|
||||
// done
|
||||
//
|
||||
|
@ -714,6 +714,11 @@ HidUsb_GetReportDescriptor(
|
|||
//
|
||||
Irp->IoStatus.Information = Length;
|
||||
|
||||
//
|
||||
// free the report buffer
|
||||
//
|
||||
ExFreePoolWithTag(Report, HIDUSB_TAG);
|
||||
|
||||
//
|
||||
// done
|
||||
//
|
||||
|
@ -909,9 +914,12 @@ HidPower(
|
|||
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 @@ HidSystemControl(
|
|||
DeviceExtension = DeviceObject->DeviceExtension;
|
||||
|
||||
//
|
||||
// copy stack location
|
||||
// skip stack location
|
||||
//
|
||||
IoCopyCurrentIrpStackLocationToNext(Irp);
|
||||
IoSkipCurrentIrpStackLocation(Irp);
|
||||
|
||||
//
|
||||
// submit request
|
||||
|
@ -1720,15 +1728,6 @@ HidPnp(
|
|||
Status = Irp->IoStatus.Status;
|
||||
}
|
||||
|
||||
//
|
||||
// free resources
|
||||
//
|
||||
if (HidDeviceExtension->HidDescriptor)
|
||||
{
|
||||
ExFreePoolWithTag(HidDeviceExtension->HidDescriptor, HIDUSB_TAG);
|
||||
HidDeviceExtension->HidDescriptor = NULL;
|
||||
}
|
||||
|
||||
//
|
||||
// done
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue