Skip to content

Commit

Permalink
use PagedPool for vusb memory allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
cezanne committed Jan 2, 2021
1 parent 4a195ac commit c4adce1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions driver/vhci_ude/vhci_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ setup_with_dsc_dev(pctx_vusb_t vusb, PUSB_DEVICE_DESCRIPTOR dsc_dev)
static BOOLEAN
setup_with_dsc_conf(pctx_vusb_t vusb, PUSB_CONFIGURATION_DESCRIPTOR dsc_conf)
{
vusb->dsc_conf = ExAllocatePoolWithTag(NonPagedPool, dsc_conf->wTotalLength, VHCI_POOLTAG);
vusb->dsc_conf = ExAllocatePoolWithTag(PagedPool, dsc_conf->wTotalLength, VHCI_POOLTAG);
if (vusb->dsc_conf == NULL) {
TRE(PLUGIN, "failed to allocate configuration descriptor");
return FALSE;
Expand All @@ -61,7 +61,7 @@ setup_with_dsc_conf(pctx_vusb_t vusb, PUSB_CONFIGURATION_DESCRIPTOR dsc_conf)
if (dsc_conf->bNumInterfaces > 0) {
int i;

vusb->intf_altsettings = (PSHORT)ExAllocatePoolWithTag(NonPagedPool, dsc_conf->bNumInterfaces * sizeof(SHORT), VHCI_POOLTAG);
vusb->intf_altsettings = (PSHORT)ExAllocatePoolWithTag(PagedPool, dsc_conf->bNumInterfaces * sizeof(SHORT), VHCI_POOLTAG);
if (vusb->intf_altsettings == NULL) {
TRE(PLUGIN, "failed to allocate alternative settings for interfaces");
return FALSE;
Expand Down
2 changes: 1 addition & 1 deletion driver/vhci_ude/vhci_queue_hc.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ create_queue_hc(pctx_vhci_t vhci)

WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&attrs, pctx_vhci_t);
attrs.SynchronizationScope = WdfSynchronizationScopeQueue;

attrs.ExecutionLevel = WdfExecutionLevelPassive;
status = WdfIoQueueCreate(vhci->hdev, &conf, &attrs, &queue);
if (NT_SUCCESS(status)) {
*TO_PVHCI(queue) = vhci;
Expand Down

0 comments on commit c4adce1

Please sign in to comment.