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:
parent
e91ae64f65
commit
059ed03284
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue