summaryrefslogtreecommitdiff
path: root/common/usb_storage.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/usb_storage.c')
-rw-r--r--common/usb_storage.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/usb_storage.c b/common/usb_storage.c
index 06ea99b2f1a..b4b79140899 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -56,6 +56,7 @@
#if (CONFIG_COMMANDS & CFG_CMD_USB)
+#include <part.h>
#include <usb.h>
#ifdef CONFIG_USB_STORAGE
@@ -174,7 +175,7 @@ void uhci_show_temp_int_td(void);
block_dev_desc_t *usb_stor_get_dev(int index)
{
- return &usb_dev_desc[index];
+ return (index < USB_MAX_STOR_DEV) ? &usb_dev_desc[index] : NULL;
}