]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_ide.c
Fix yet another recently introduced bug.
[karo-tx-uboot.git] / common / cmd_ide.c
index 915ee76361d1a8e52353053ea97e00f62d180bdd..1cc88e3e508d5bf091dc4d3ae8f6c0a19227de6e 100644 (file)
@@ -450,11 +450,12 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        checksum = ntohl(hdr->ih_hcrc);
        hdr->ih_hcrc = 0;
 
-       if (crc32 (0, (char *)&hdr, sizeof(image_header_t)) != checksum) {
+       if (crc32 (0, (char *)hdr, sizeof(image_header_t)) != checksum) {
                puts ("\n** Bad Header Checksum **\n");
                SHOW_BOOT_PROGRESS (-2);
                return 1;
        }
+       hdr->ih_hcrc = htonl(checksum); /* restore checksum for later use */
 
        print_image_hdr (hdr);