summaryrefslogtreecommitdiffstats
path: root/drivers/usb/cdns3/cdnsp-mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/cdns3/cdnsp-mem.c')
-rw-r--r--drivers/usb/cdns3/cdnsp-mem.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/cdns3/cdnsp-mem.c b/drivers/usb/cdns3/cdnsp-mem.c
index ad9aee3f1e39..97866bfb2da9 100644
--- a/drivers/usb/cdns3/cdnsp-mem.c
+++ b/drivers/usb/cdns3/cdnsp-mem.c
@@ -987,6 +987,9 @@ int cdnsp_endpoint_init(struct cdnsp_device *pdev,
/* Set up the endpoint ring. */
pep->ring = cdnsp_ring_alloc(pdev, 2, ring_type, max_packet, mem_flags);
+ if (!pep->ring)
+ return -ENOMEM;
+
pep->skip = false;
/* Fill the endpoint context */