Minor fix - check for malloc failure in USB cntl allocation.
[seabios.git] / src / usb-ohci.c
index 317f200c65f0348ae1c2082d28a5265716e2e266..9107db2bcd2af68e76fc7ceb9656d7dd4d1c73c6 100644 (file)
@@ -209,6 +209,10 @@ ohci_init(struct pci_device *pci, int busid)
     if (! CONFIG_USB_OHCI)
         return;
     struct usb_ohci_s *cntl = malloc_tmphigh(sizeof(*cntl));
+    if (!cntl) {
+        warn_noalloc();
+        return;
+    }
     memset(cntl, 0, sizeof(*cntl));
     cntl->usb.busid = busid;
     cntl->usb.pci = pci;