Minor fix - check for malloc failure in USB cntl allocation.
[seabios.git] / src / usb-ehci.c
index 5028c0d6688c3b1c7caa2383d3157313891aac1a..a60c60715cad93693170fb1bf9798ca7e460bacd 100644 (file)
@@ -263,6 +263,10 @@ ehci_init(struct pci_device *pci, int busid, struct pci_device *comppci)
     }
 
     struct usb_ehci_s *cntl = malloc_tmphigh(sizeof(*cntl));
+    if (!cntl) {
+        warn_noalloc();
+        return -1;
+    }
     memset(cntl, 0, sizeof(*cntl));
     cntl->usb.busid = busid;
     cntl->usb.pci = pci;