From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Anthony Liguori <aliguori@amazon.com>
Subject: [Qemu-devel] [PULL 6/8] block/vhdx: Error checking fixes
Date: Fri, 31 Jan 2014 22:19:47 +0100 [thread overview]
Message-ID: <1391203189-6552-7-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1391203189-6552-1-git-send-email-stefanha@redhat.com>
From: Markus Armbruster <armbru@redhat.com>
Errors are inadvertently ignored in a few places. Has always been
broken. Spotted by Coverity.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
block/vhdx-log.c | 4 ++--
block/vhdx.c | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/block/vhdx-log.c b/block/vhdx-log.c
index 8c9ae0d..02755b8 100644
--- a/block/vhdx-log.c
+++ b/block/vhdx-log.c
@@ -965,8 +965,8 @@ static int vhdx_log_write(BlockDriverState *bs, BDRVVHDXState *s,
cpu_to_le32s((uint32_t *)(buffer + 4));
/* now write to the log */
- vhdx_log_write_sectors(bs, &s->log, §ors_written, buffer,
- desc_sectors + sectors);
+ ret = vhdx_log_write_sectors(bs, &s->log, §ors_written, buffer,
+ desc_sectors + sectors);
if (ret < 0) {
goto exit;
}
diff --git a/block/vhdx.c b/block/vhdx.c
index 9ee0a61..55689cf 100644
--- a/block/vhdx.c
+++ b/block/vhdx.c
@@ -374,7 +374,7 @@ static int vhdx_update_header(BlockDriverState *bs, BDRVVHDXState *s,
inactive_header->log_guid = *log_guid;
}
- vhdx_write_header(bs->file, inactive_header, header_offset, true);
+ ret = vhdx_write_header(bs->file, inactive_header, header_offset, true);
if (ret < 0) {
goto exit;
}
@@ -1810,13 +1810,13 @@ static int vhdx_create(const char *filename, QEMUOptionParameter *options,
creator = g_utf8_to_utf16("QEMU v" QEMU_VERSION, -1, NULL,
&creator_items, NULL);
signature = cpu_to_le64(VHDX_FILE_SIGNATURE);
- bdrv_pwrite(bs, VHDX_FILE_ID_OFFSET, &signature, sizeof(signature));
+ ret = bdrv_pwrite(bs, VHDX_FILE_ID_OFFSET, &signature, sizeof(signature));
if (ret < 0) {
goto delete_and_exit;
}
if (creator) {
- bdrv_pwrite(bs, VHDX_FILE_ID_OFFSET + sizeof(signature), creator,
- creator_items * sizeof(gunichar2));
+ ret = bdrv_pwrite(bs, VHDX_FILE_ID_OFFSET + sizeof(signature),
+ creator, creator_items * sizeof(gunichar2));
if (ret < 0) {
goto delete_and_exit;
}
--
1.8.5.3
next prev parent reply other threads:[~2014-01-31 21:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-31 21:19 [Qemu-devel] [PULL 0/8] Block patches Stefan Hajnoczi
2014-01-31 21:19 ` [Qemu-devel] [PULL 1/8] Describe flaws in qcow/qcow2 encryption in the docs Stefan Hajnoczi
2014-01-31 21:19 ` [Qemu-devel] [PULL 2/8] block: remove QED .bdrv_make_empty implementation Stefan Hajnoczi
2014-01-31 21:19 ` [Qemu-devel] [PULL 3/8] block: remove qcow2 " Stefan Hajnoczi
2014-01-31 21:19 ` [Qemu-devel] [PULL 4/8] block/vmdk: add basic .bdrv_check support Stefan Hajnoczi
2014-01-31 21:19 ` [Qemu-devel] [PULL 5/8] qemu-iotests: Drop assert_no_active_commit in case 040 Stefan Hajnoczi
2014-01-31 21:19 ` Stefan Hajnoczi [this message]
2014-01-31 21:19 ` [Qemu-devel] [PULL 7/8] dataplane: Comment fix Stefan Hajnoczi
2014-01-31 21:19 ` [Qemu-devel] [PULL 8/8] qemu-iotests: only run 071 on qcow2 Stefan Hajnoczi
2014-02-05 16:38 ` [Qemu-devel] [PULL 0/8] Block patches Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1391203189-6552-7-git-send-email-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=aliguori@amazon.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).