mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2026-06-25 11:43:20 +02:00
USB: whci-hcd: add check for dma mapping error
commit f9fa1887dc upstream.
qset_fill_page_list() do not check for dma mapping errors.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
parent
485274cf9a
commit
7d190cac70
|
|
@ -377,6 +377,10 @@ static int qset_fill_page_list(struct whc *whc, struct whc_std *std, gfp_t mem_f
|
|||
if (std->pl_virt == NULL)
|
||||
return -ENOMEM;
|
||||
std->dma_addr = dma_map_single(whc->wusbhc.dev, std->pl_virt, pl_len, DMA_TO_DEVICE);
|
||||
if (dma_mapping_error(whc->wusbhc.dev, std->dma_addr)) {
|
||||
kfree(std->pl_virt);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
for (p = 0; p < std->num_pointers; p++) {
|
||||
std->pl_virt[p].buf_ptr = cpu_to_le64(dma_addr);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user