Skip to content

Commit

Permalink
Fix issues with igvmbld
Browse files Browse the repository at this point in the history
This change fixes the initialization of padding at the end of a data
object and eliminates dead code.

Signed-off-by: Jon Lange <jlange@microsoft.com>
  • Loading branch information
msft-jlange committed Jan 10, 2024
1 parent 02953a0 commit 6b96d93
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions igvmbld/igvmbld.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ DATA_OBJ *allocate_data_object(uint64_t address, uint32_t size, uint32_t data_si
// the final file.
if (allocation_size != data_size)
{
memset((uint8_t *)data_object->data, data_size, allocation_size - data_size);
memset((uint8_t *)data_object->data + data_size, 0, allocation_size - data_size);
}
}
else
Expand Down Expand Up @@ -950,21 +950,13 @@ int main(int argc, const char *argv[])
{
if (fw_filename != NULL)
{
if (is_hyperv)
err = read_hyperv_igvm_file(fw_filename, &fw_info);
if (err != 0)
{
err = read_hyperv_igvm_file(fw_filename, &fw_info);
if (err != 0)
{
return err;
}

address = fw_info.fw_info.start + fw_info.fw_info.size;
}
else
{
fprintf(stderr, "--firmware only supported for hyperv targets\n");
return 1;
return err;
}

address = fw_info.fw_info.start + fw_info.fw_info.size;
}
}

Expand Down

0 comments on commit 6b96d93

Please sign in to comment.