summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2020-03-12 16:00:31 +0000
committerPeter Maydell <peter.maydell@linaro.org>2020-03-12 16:00:31 +0000
commit10b114008acc1f7ae55eaf2646e25114e878ddac (patch)
tree6456b4e1f4169a94e1d12c507c344e2613daca61
parent67d9ef7d541c3d21a25796c51c26da096a433565 (diff)
parent80aab795f8a6d53cdeb55cc6ffac50b5e5ce9dc2 (diff)
downloadfocaccia-qemu-10b114008acc1f7ae55eaf2646e25114e878ddac.tar.gz
focaccia-qemu-10b114008acc1f7ae55eaf2646e25114e878ddac.zip
Merge remote-tracking branch 'remotes/vivier/tags/q800-for-5.0-pull-request' into staging
Fix Coverity CID 1412799 (Error handling issues)

# gpg: Signature made Thu 12 Mar 2020 15:15:01 GMT
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "laurent@vivier.eu"
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier/tags/q800-for-5.0-pull-request:
  q800: fix coverity warning CID 1412799

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to '')
-rw-r--r--hw/misc/mac_via.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/misc/mac_via.c b/hw/misc/mac_via.c
index b7d0012794..81343301b1 100644
--- a/hw/misc/mac_via.c
+++ b/hw/misc/mac_via.c
@@ -30,6 +30,7 @@
 #include "hw/qdev-properties.h"
 #include "sysemu/block-backend.h"
 #include "trace.h"
+#include "qemu/log.h"
 
 /*
  * VIAs: There are two in every machine,
@@ -381,8 +382,10 @@ static void via2_irq_request(void *opaque, int irq, int level)
 static void pram_update(MacVIAState *m)
 {
     if (m->blk) {
-        blk_pwrite(m->blk, 0, m->mos6522_via1.PRAM,
-                   sizeof(m->mos6522_via1.PRAM), 0);
+        if (blk_pwrite(m->blk, 0, m->mos6522_via1.PRAM,
+                       sizeof(m->mos6522_via1.PRAM), 0) < 0) {
+            qemu_log("pram_update: cannot write to file\n");
+        }
     }
 }