Skip to content
Snippets Groups Projects
Commit 8afc22a2 authored by Zhou Jie's avatar Zhou Jie Committed by David Gibson
Browse files

Added negative check for get_image_size()


This patch adds check for negative return value from get_image_size(),
where it is missing. It avoids unnecessary two function calls.

Signed-off-by: default avatarZhou Jie <zhoujie2011@cn.fujitsu.com>
Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
parent 5c29dd8c
No related branches found
No related tags found
No related merge requests found
......@@ -1842,6 +1842,10 @@ static void ppc_spapr_init(MachineState *machine)
exit(1);
}
spapr->rtas_size = get_image_size(filename);
if (spapr->rtas_size < 0) {
error_report("Could not get size of LPAR rtas '%s'", filename);
exit(1);
}
spapr->rtas_blob = g_malloc(spapr->rtas_size);
if (load_image_size(filename, spapr->rtas_blob, spapr->rtas_size) < 0) {
error_report("Could not load LPAR rtas '%s'", filename);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment