disk: rkparm: fix get partition issue

Without this patch, it always returns the last partition when
"idx" is larger than the last partititon.

Change-Id: I1d126861327c02cab7dd8cc00dd0800651f7da3c
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
This commit is contained in:
Joseph Chen 2019-06-24 12:06:07 +08:00 committed by Jianhong Chen
parent e91ae64f65
commit 059ed03284
1 changed files with 2 additions and 2 deletions

View File

@ -271,8 +271,8 @@ static int part_get_info_rkparm(struct blk_desc *dev_desc, int idx,
part_num ++;
}
if (part_num > idx) {
printf("%s Invalid partition no.%d\n", __func__, idx);
if (part_num < idx) {
debug("%s Invalid partition no.%d\n", __func__, idx);
return -EINVAL;
}