image: call image_align after checking hash

This commit is contained in:
Pali Rohár committed 2012-08-08 20:39:27 +02:00
1 parent d10814e808
commit b581c7f25d
1 file changed
+2 -1
+2 -1
View File
@@ -237,7 +237,6 @@ struct image * image_alloc_from_shared_fd(int fd, size_t size, size_t offset, ui
image->cur = 0;
image_append(image, type, device, hwrevs, version, layout);
image_align(image);
if ( image->hash != hash ) {
fprintf(stderr, "Error: Image hash mishmash (expected %#04x)\n", image->hash);
@@ -245,6 +244,8 @@ struct image * image_alloc_from_shared_fd(int fd, size_t size, size_t offset, ui
return NULL;
}
image_align(image);
return image;
}