hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/staging/emxx_udc/emxx_udc.c
....@@ -2591,10 +2591,15 @@
25912591 req->unaligned = false;
25922592
25932593 if (req->unaligned) {
2594
- if (!ep->virt_buf)
2594
+ if (!ep->virt_buf) {
25952595 ep->virt_buf = dma_alloc_coherent(udc->dev, PAGE_SIZE,
25962596 &ep->phys_buf,
25972597 GFP_ATOMIC | GFP_DMA);
2598
+ if (!ep->virt_buf) {
2599
+ spin_unlock_irqrestore(&udc->lock, flags);
2600
+ return -ENOMEM;
2601
+ }
2602
+ }
25982603 if (ep->epnum > 0) {
25992604 if (ep->direct == USB_DIR_IN)
26002605 memcpy(ep->virt_buf, req->req.buf,