Skip to content

Commit

Permalink
USB: xhci: Fix scratchpad deallocation.
Browse files Browse the repository at this point in the history
The scratchpad_free() function uses xhci->page_size to free some memory
with pci_free_consistent().  However, the page_size is set to zero before
the call, causing kernel oopses on driver unload.  Call scratchpad_free()
before setting xhci->page_size to zero.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Acked-by: John Youn <John.Youn@synopsys.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Sarah Sharp authored and Greg Kroah-Hartman committed Nov 18, 2009
1 parent 2fa88da commit 5294bea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/host/xhci-mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -843,9 +843,9 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
xhci->dcbaa, xhci->dcbaa->dma);
xhci->dcbaa = NULL;

scratchpad_free(xhci);
xhci->page_size = 0;
xhci->page_shift = 0;
scratchpad_free(xhci);
}

int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
Expand Down

0 comments on commit 5294bea

Please sign in to comment.