test: storage: Fix board may not have devnum env

If the board do not have the 'devnum', the env_get() returns NULL
and strcmp will lead to "data abort".

Change-Id: I329237b61fc96bc90e7a07653b665192d6a9d7b8
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
This commit is contained in:
Kever Yang 2019-09-23 17:51:10 +08:00
parent d0ff3d4548
commit 9c7862b8bf
1 changed files with 1 additions and 1 deletions

View File

@ -219,7 +219,7 @@ static int do_test_storage(cmd_tbl_t *cmdtp, int flag,
}
/* 7. Switch back to default system devnum */
if (devtype && !strcmp(devtype, "mmc") &&
if (devtype && !strcmp(devtype, "mmc") && env_get("devnum") &&
strcmp(devnum, env_get("devnum"))) {
ret = run_command(cmd, 0);
if (ret) {