From: Tom Rini Date: Tue, 15 Aug 2017 01:01:30 +0000 (-0400) Subject: spl: spl_mmc.c Correct blk_dread() return value check X-Git-Tag: v2025.01-rc5-pxa1908~5998 X-Git-Url: http://git.dujemihanovic.xyz/%7B%7B%20%24style.RelPermalink%20%7D%7D?a=commitdiff_plain;h=9585dd3fffaa8b7bd37044cc1870a45f2ca0ee3d;p=u-boot.git spl: spl_mmc.c Correct blk_dread() return value check The function blk_dread will return -ENOSYS on failure or on success the number of blocks read, which must be the number asked to read (otherwise it failed somewhere). Correct this check. Signed-off-by: Tom Rini --- diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index d95f94ca15..b2cccc6c6e 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -200,7 +200,7 @@ static int mmc_load_image_raw_os(struct spl_image_info *spl_image, CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR, CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS, (void *) CONFIG_SYS_SPL_ARGS_ADDR); - if (count == 0) { + if (count != CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS) { #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT puts("mmc_load_image_raw_os: mmc block read error\n"); #endif