summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcmd/mmc.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/cmd/mmc.c b/cmd/mmc.c
index 9372ec1b66..491eec040f 100755
--- a/cmd/mmc.c
+++ b/cmd/mmc.c
@@ -1444,16 +1444,15 @@ static int create_mmc_fdisk(int argc, char * const argv[])
static int do_fdisk(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
- if (argv[2][0] != '0' && argv[2][0] != '1') {
- printf("Error :");
- printf("Wrong device number\n");
- return CMD_RET_FAILURE;
- }
-
switch (argc) {
default :
break;
case 3: case 6: case 7:
+ if (argv[2][0] != '0' && argv[2][0] != '1') {
+ printf("Error :");
+ printf("Wrong device number\n");
+ return CMD_RET_FAILURE;
+ }
if (argv[1][1] == 'c')
create_mmc_fdisk(argc, argv);
if (argv[1][1] == 'c' || argv[1][1] == 'p') {