]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: xhci: Fix OOPS in xhci error handling code
authorAl Cooper <alcooperx@gmail.com>
Thu, 11 Sep 2014 10:55:49 +0000 (13:55 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 Oct 2014 20:40:58 +0000 (13:40 -0700)
commit714f9e749dd87c07dcf261fdbacb38c578cda0c2
tree8516ea0a45f877665dc05d36bd99601495083d3f
parenta8a48a03cf59cacfea21acba190ddc4de77be60b
usb: xhci: Fix OOPS in xhci error handling code

commit 0eda06c7c17ae48d7db69beef57f6e2b20bc3c72 upstream.

The xhci driver will OOPS on resume from S2/S3 if dma_alloc_coherent()
is out of memory. This is a result of two things:
1. xhci_mem_cleanup() in xhci-mem.c free's xhci->lpm_command if
it's not NULL, but doesn't set it to NULL after the free.
2. xhci_mem_cleanup() is called twice on resume, once for normal
restart and once from xhci_mem_init() if dma_alloc_coherent() fails,
resulting in a free of xhci->lpm_command that has already been freed.
The fix is to set xhci->lpm_command to NULL after freeing it.

Signed-off-by: Al Cooper <alcooperx@gmail.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-mem.c