summaryrefslogtreecommitdiff
path: root/payloads/libpayload/drivers/usb/usbmsc.c
diff options
context:
space:
mode:
Diffstat (limited to 'payloads/libpayload/drivers/usb/usbmsc.c')
-rw-r--r--payloads/libpayload/drivers/usb/usbmsc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/payloads/libpayload/drivers/usb/usbmsc.c b/payloads/libpayload/drivers/usb/usbmsc.c
index ad4a10c146..f24bd6d857 100644
--- a/payloads/libpayload/drivers/usb/usbmsc.c
+++ b/payloads/libpayload/drivers/usb/usbmsc.c
@@ -346,6 +346,9 @@ usb_msc_init (usbdev_t *dev)
}
dev->data = malloc (sizeof (usbmsc_inst_t));
+ if (!dev->data)
+ usb_fatal("Not enough memory for USB MSC device.\n");
+
MSC_INST (dev)->bulk_in = 0;
MSC_INST (dev)->bulk_out = 0;