[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] RDMA: Fix error exits (for 2.4)
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] RDMA: Fix error exits (for 2.4) |
Date: |
Fri, 10 Jul 2015 23:10:21 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 |
Juan, okay for me to pick it up together with a bunch of other Coverity
fixes?
Paolo
On 10/07/2015 21:08, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <address@hidden>
>
> The error checks I added used 'break' after the error, but I'm
> in a switch inside the while loop, so they need to be 'goto out'.
>
> Spotted by coverity; entries 1311368 and 1311369
>
> Fixes: afcddefd
>
> Signed-off-by: Dr. David Alan Gilbert <address@hidden>
> ---
> migration/rdma.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/migration/rdma.c b/migration/rdma.c
> index f106b2a..74876fd 100644
> --- a/migration/rdma.c
> +++ b/migration/rdma.c
> @@ -2997,7 +2997,7 @@ static int qemu_rdma_registration_handle(QEMUFile *f,
> void *opaque)
> (unsigned int)comp->block_idx,
> rdma->local_ram_blocks.nb_blocks);
> ret = -EIO;
> - break;
> + goto out;
> }
> block = &(rdma->local_ram_blocks.block[comp->block_idx]);
>
> @@ -3092,7 +3092,7 @@ static int qemu_rdma_registration_handle(QEMUFile *f,
> void *opaque)
> (unsigned int)reg->current_index,
> rdma->local_ram_blocks.nb_blocks);
> ret = -ENOENT;
> - break;
> + goto out;
> }
> block = &(rdma->local_ram_blocks.block[reg->current_index]);
> if (block->is_ram_block) {
> @@ -3102,7 +3102,7 @@ static int qemu_rdma_registration_handle(QEMUFile *f,
> void *opaque)
> block->block_name, block->offset,
> reg->key.current_addr);
> ret = -ERANGE;
> - break;
> + goto out;
> }
> host_addr = (block->local_host_addr +
> (reg->key.current_addr - block->offset));
> @@ -3118,7 +3118,7 @@ static int qemu_rdma_registration_handle(QEMUFile *f,
> void *opaque)
> " chunk: %" PRIx64,
> block->block_name, reg->key.chunk);
> ret = -ERANGE;
> - break;
> + goto out;
> }
> }
> chunk_start = ram_chunk_start(block, chunk);
>