projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1b38ccc
)
microvm: check g_file_set_contents() return value
author
Gerd Hoffmann
<kraxel@redhat.com>
Mon, 8 Nov 2021 13:07:18 +0000
(14:07 +0100)
committer
Gerd Hoffmann
<kraxel@redhat.com>
Mon, 22 Nov 2021 10:14:28 +0000
(11:14 +0100)
Fixes: CID 1465239
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-Id: <
20211108130718
.840216-3-kraxel@redhat.com>
hw/i386/microvm-dt.c
patch
|
blob
|
history
diff --git
a/hw/i386/microvm-dt.c
b/hw/i386/microvm-dt.c
index a6a59a6e12cdd3278e9b71abff5f5cabf139caad..9c3c4995b41da18fca17000c1772f581b1979df5 100644
(file)
--- a/
hw/i386/microvm-dt.c
+++ b/
hw/i386/microvm-dt.c
@@
-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__);