Received: from eggs.gnu.org ([2001:4830:134:3::10]:39438) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEYiA-0006lx-6w for qemu-devel@nongnu.org; Mon, 13 Jul 2015 04:03:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZEYi6-0005C7-TA for qemu-devel@nongnu.org; Mon, 13 Jul 2015 04:03:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34199) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEYi6-0005Bh-OH for qemu-devel@nongnu.org; Mon, 13 Jul 2015 04:03:34 -0400 From: Juan Quintela In-Reply-To: <55A034BD.90007@redhat.com> (Paolo Bonzini's message of "Fri, 10 Jul 2015 23:10:21 +0200") References: <1436555332-19076-1-git-send-email-dgilbert@redhat.com> <55A034BD.90007@redhat.com> Date: Mon, 13 Jul 2015 10:03:31 +0200 Message-ID: <87a8v0mqlo.fsf@neno.neno> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] RDMA: Fix error exits (for 2.4) Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: amit.shah@redhat.com, mrhines@us.ibm.com, "Dr. David Alan Gilbert (git)" , qemu-devel@nongnu.org Paolo Bonzini wrote: > Juan, okay for me to pick it up together with a bunch of other Coverity > fixes? Yeap. Thanks. > > Paolo > > On 10/07/2015 21:08, Dr. David Alan Gilbert (git) wrote: >> From: "Dr. David Alan Gilbert" >> >> 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 You mangle the commit by hand? Only letters? Next time you will get words, right? O:-) >> >> Signed-off-by: Dr. David Alan Gilbert >> --- >> 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); >>