spl: spl_mmc.c Correct blk_dread() return value check
PATCH 1/1 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 <[email protected]>
--- common/spl/spl_mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/spl/spl_mmc.c +1 -1
@@ -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
Signature · 1 line
1.9.1
Quoted 5 lines · Tom Rini
The function
blk_dreadwill return-ENOSYSon 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 <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170820/4ac9e6aa/attachment.sig>