Signed-off-by: Jules Maselbas <jmaselbas@xxxxxxxxx> --- drivers/usb/dwc2/host.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/usb/dwc2/host.c b/drivers/usb/dwc2/host.c index ea2facbc8..ccc32ba04 100644 --- a/drivers/usb/dwc2/host.c +++ b/drivers/usb/dwc2/host.c @@ -157,6 +157,11 @@ static int transfer_chunk(struct dwc2 *dwc2, u8 hc, dma_addr = dma_map_single(dwc2->dev, buffer, xfer_len, in ? DMA_FROM_DEVICE : DMA_TO_DEVICE); + if (dma_mapping_error(dwc2->dev, dma_addr)) { + dwc2_err(dwc2, "Failed to map buffer@0x%p for dma\n", buffer); + return -EFAULT; + } + dwc2_dbg(dwc2, "chunk: pid=%d xfer_len=%u pkts=%u dma_addr=%pad\n", *pid, xfer_len, num_packets, (void *)dma_addr); -- 2.17.1 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox