[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 05/12] block: Silence Coverity in bdrv_drop_intermedi
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 05/12] block: Silence Coverity in bdrv_drop_intermediate() |
Date: |
Tue, 19 Mar 2019 16:46:13 +0100 |
Coverity doesn't like that the return value of bdrv_check_update_perm()
stays unused only in this place (CID 1399710).
Even if checking local_err should be equivalent to checking ret < 0,
let's switch to using the return value to be more consistent (and in
case of a bug somewhere down the call chain, forgetting to assign errp
is more likely than returning 0 for an error case).
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
---
block.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/block.c b/block.c
index ed9253c786..0a93ee9ac8 100644
--- a/block.c
+++ b/block.c
@@ -4350,11 +4350,10 @@ int bdrv_drop_intermediate(BlockDriverState *top,
BlockDriverState *base,
QLIST_FOREACH_SAFE(c, &top->parents, next_parent, next) {
/* Check whether we are allowed to switch c from top to base */
GSList *ignore_children = g_slist_prepend(NULL, c);
- bdrv_check_update_perm(base, NULL, c->perm, c->shared_perm,
- ignore_children, &local_err);
+ ret = bdrv_check_update_perm(base, NULL, c->perm, c->shared_perm,
+ ignore_children, &local_err);
g_slist_free(ignore_children);
- if (local_err) {
- ret = -EPERM;
+ if (ret < 0) {
error_report_err(local_err);
goto exit;
}
--
2.20.1
- [Qemu-devel] [PULL 00/12] Block layer patches, Kevin Wolf, 2019/03/19
- [Qemu-devel] [PULL 07/12] vl: Fix to create migration object before block backends again, Kevin Wolf, 2019/03/19
- [Qemu-devel] [PULL 06/12] iotests: 153: Wait for an answer to QMP commands, Kevin Wolf, 2019/03/19
- [Qemu-devel] [PULL 09/12] blockjob: fix user pause in block_job_error_action, Kevin Wolf, 2019/03/19
- [Qemu-devel] [PULL 05/12] block: Silence Coverity in bdrv_drop_intermediate(),
Kevin Wolf <=
- [Qemu-devel] [PULL 12/12] qemu-iotests: Treat custom TEST_DIR in 051, Kevin Wolf, 2019/03/19
- [Qemu-devel] [PULL 10/12] block: Make bdrv_{copy_on_read, crypto_luks, replication} static, Kevin Wolf, 2019/03/19
- [Qemu-devel] [PULL 11/12] blockdev: Check @replaces in blockdev_mirror_common, Kevin Wolf, 2019/03/19
- [Qemu-devel] [PULL 08/12] qemu-iotests: Fix 232 for non-qcow2, Kevin Wolf, 2019/03/19
- [Qemu-devel] [PULL 02/12] qcow2: Fix data file error condition in qcow2_co_create(), Kevin Wolf, 2019/03/19
- [Qemu-devel] [PULL 01/12] mirror: Confirm we're quiesced only if the job is paused or cancelled, Kevin Wolf, 2019/03/19
- [Qemu-devel] [PULL 03/12] qapi: fix block-latency-histogram-set description and examples, Kevin Wolf, 2019/03/19
- [Qemu-devel] [PULL 04/12] vmdk: Support version=3 in VMDK descriptor files, Kevin Wolf, 2019/03/19
- Re: [Qemu-devel] [PULL 00/12] Block layer patches, Peter Maydell, 2019/03/19