diff options
author | Laurent Vivier <laurent@vivier.eu> | 2020-02-10 14:22:52 +0100 |
---|---|---|
committer | Laurent Vivier <laurent@vivier.eu> | 2020-03-12 16:05:48 +0100 |
commit | 80aab795f8a6d53cdeb55cc6ffac50b5e5ce9dc2 (patch) | |
tree | f4d24f1fd7bead0bd376e3821bfd42bd7ce36d39 /hw | |
parent | 104933c4a973960dea605b06fcd5d0d478255d77 (diff) | |
download | qemu-80aab795f8a6d53cdeb55cc6ffac50b5e5ce9dc2.zip qemu-80aab795f8a6d53cdeb55cc6ffac50b5e5ce9dc2.tar.gz qemu-80aab795f8a6d53cdeb55cc6ffac50b5e5ce9dc2.tar.bz2 |
q800: fix coverity warning CID 1412799
Check the return value of blk_write() and log an error if any
Fixes: Coverity CID 1412799 (Error handling issues)
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200210132252.381343-1-laurent@vivier.eu>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/misc/mac_via.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/misc/mac_via.c b/hw/misc/mac_via.c index b7d0012..8134330 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"); + } } } |