summaryrefslogtreecommitdiffstats
path: root/cmd/usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/usb.c')
-rw-r--r--cmd/usb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd/usb.c b/cmd/usb.c
index b83d3233b7..58d9db29d7 100644
--- a/cmd/usb.c
+++ b/cmd/usb.c
@@ -800,7 +800,8 @@ static int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
int dev = (int)simple_strtoul(argv[2], NULL, 10);
printf("\nUSB device %d: ", dev);
stor_dev = blk_get_devnum_by_type(IF_TYPE_USB, dev);
- if (stor_dev == NULL) {
+ if ((stor_dev == NULL) ||
+ (stor_dev->if_type == IF_TYPE_UNKNOWN)) {
printf("unknown device\n");
return 1;
}
OpenPOWER on IntegriCloud