From 059ed03284aea1a35c7f54a0119d9f0a3ec6707d Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Mon, 24 Jun 2019 12:06:07 +0800 Subject: [PATCH] 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 --- disk/part_rkparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/disk/part_rkparm.c b/disk/part_rkparm.c index 8383b641de..15ec243852 100644 --- a/disk/part_rkparm.c +++ b/disk/part_rkparm.c @@ -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; }