usb: xhci-mem: use passed in GFP flags instead of GFP_KERNEL
Subsystems (3)
PATCH 1/1 usb: xhci-mem: use passed in GFP flags instead of GFP_KERNEL
We normally use the passed in gfp flags for allocations, it's just these two which were missed.
Fixes 22d45f01a836 ("usb/xhci: replace pci_*_consistent() with dma_*_coherent()")
Signed-off-by Dan Carpenter <[email protected]>
---
From static analysis. Not tested.
drivers/usb/host/xhci-mem.c +2 -2
@@ -2384,7 +2384,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)* "physically contiguous and 64-byte (cache line) aligned". */ xhci->dcbaa =dma_alloc_coherent (dev,sizeof (*xhci->dcbaa), &dma, -GFP_KERNEL ); + flags);if (!xhci->dcbaa) goto fail;memset (xhci->dcbaa,0 ,sizeof *(xhci->dcbaa));
@@ -2480,7 +2480,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) xhci->erst.entries =dma_alloc_coherent (dev,sizeof (struct xhci_erst_entry ) *ERST_NUM_SEGS , &dma, -GFP_KERNEL ); + flags);if (!xhci->erst.entries) goto fail; xhci_dbg_trace(xhci, trace_xhci_dbg_init,
Quoted 2 lines · Dan Carpenter
We normally use the passed in gfp flags for allocations, it's just these two which were missed.
You seem to be right. xhci_mem_init() has only one caller with GFP_KERNEL as argument. You could unwind it.
Quoted 2 lines
Fixes 22d45f01a836 ("usb/xhci: replace pci_*_consistent() with dma_*_coherent()")Signed-off-by Dan Carpenter <[email protected]>
Sebastian