X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=common%2Ffb_mmc.c;h=26d60b88d0cad12e5fa6bf8f0753be757f8c75f6;hb=c07f38208a73bbe3efaa939d6742096c1cb7e0ce;hp=2a8ba15f3190b96cd4ab08bb580992b3af0dc0b0;hpb=2341c80cd261291aff2c58b70bacc053ecca9d1d;p=u-boot diff --git a/common/fb_mmc.c b/common/fb_mmc.c index 2a8ba15f31..26d60b88d0 100644 --- a/common/fb_mmc.c +++ b/common/fb_mmc.c @@ -132,7 +132,7 @@ static lbaint_t fb_mmc_get_boot_header(struct blk_desc *dev_desc, /* Read the boot image header */ res = blk_dread(dev_desc, info->start, hdr_sectors, (void *)hdr); - if (res == 0) { + if (res != hdr_sectors) { error("cannot read header from boot partition"); fastboot_fail("cannot read header from boot partition"); return 0; @@ -215,7 +215,7 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc, ramdisk_buffer = (u8 *)hdr + (hdr_sectors * info.blksz); res = blk_dread(dev_desc, ramdisk_sector_start, ramdisk_sectors, ramdisk_buffer); - if (res == 0) { + if (res != ramdisk_sectors) { error("cannot read ramdisk from boot partition"); fastboot_fail("cannot read ramdisk from boot partition"); return -1;