mirror of
https://github.com/torvalds/linux.git
synced 2026-06-10 07:32:29 +02:00
xhci: check for failed dma pool allocation
commit025f880cb2upstream. Fail and free the container context in case dma_pool_alloc() can't allocate the raw context data part of it This patch should be backported to kernels as old as 2.6.31, that contain the commitd115b04818"USB: xhci: Support for 64-byte contexts". Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: John Youn <johnyoun@synopsys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
ee093f6edc
commit
d1fc72e985
|
|
@ -369,6 +369,10 @@ static struct xhci_container_ctx *xhci_alloc_container_ctx(struct xhci_hcd *xhci
|
|||
ctx->size += CTX_SIZE(xhci->hcc_params);
|
||||
|
||||
ctx->bytes = dma_pool_alloc(xhci->device_pool, flags, &ctx->dma);
|
||||
if (!ctx->bytes) {
|
||||
kfree(ctx);
|
||||
return NULL;
|
||||
}
|
||||
memset(ctx->bytes, 0, ctx->size);
|
||||
return ctx;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user