Skip to content
Snippets Groups Projects
Commit b9e5628c authored by Gerd Hoffmann's avatar Gerd Hoffmann
Browse files

microvm: check g_file_set_contents() return value


Fixes: CID 1465239
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
Message-Id: <20211108130718.840216-3-kraxel@redhat.com>
parent 1b38ccc9
No related branches found
No related tags found
No related merge requests found
......@@ -336,7 +336,10 @@ void dt_setup_microvm(MicrovmMachineState *mms)
if (debug) {
fprintf(stderr, "%s: writing microvm.fdt\n", __func__);
g_file_set_contents("microvm.fdt", mms->fdt, size, NULL);
if (!g_file_set_contents("microvm.fdt", mms->fdt, size, NULL)) {
fprintf(stderr, "%s: writing microvm.fdt failed\n", __func__);
return;
}
int ret = system("dtc -I dtb -O dts microvm.fdt");
if (ret != 0) {
fprintf(stderr, "%s: oops, dtc not installed?\n", __func__);
......
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