From: Tom Rini Date: Mon, 6 Nov 2017 18:28:15 -0500 Subject: [U-Boot] disk: part_dos: fix part_get_info_extended() function In-Reply-To: <1509612394-24359-1-git-send-email-shawnguo@kernel.org> References: <1509612394-24359-1-git-send-email-shawnguo@kernel.org> Message-ID: <20171106232815.GD32663@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, Nov 02, 2017 at 04:46:34PM +0800, Shawn Guo wrote: > From: Shawn Guo > > The check in part_get_info_extended() for a successful partition > searching misses a condition for extended partition. In case of > (ext_part_sector == 0), we should anyway mark the partition as found, > even if it's an extended partition, i.e. (is_extended(pt->sys_ind) == 0). > Otherwise, the extended partition (type 0x0f) will never be identified, > and the following recursive call to part_get_info_extended() will get a > wrong 'part_num' and 'which_part' parameter. In the end, all those > partitions in extended table will not be identified. > > Let's add the missing OR condition of (ext_part_sector == 0) for > is_extended() check to fix the problem. > > The issue is discovered by running fastboot flash to an extended > partition on eMMC. > > $ fastboot flash mmcsda5 cache.img > target reported max download size of 536870912 bytes > sending 'mmcsda5' (18796 KB)... > OKAY [ 2.144s] > writing 'mmcsda5'... > FAILED (remote: cannot find partition) > finished. total time: 2.261s > > Signed-off-by: Shawn Guo Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: