From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFnVC-0001gF-92 for qemu-devel@nongnu.org; Thu, 16 Jul 2015 14:03:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZFnV8-0002vQ-3J for qemu-devel@nongnu.org; Thu, 16 Jul 2015 14:03:22 -0400 Received: from mail-wg0-x22c.google.com ([2a00:1450:400c:c00::22c]:36842) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFnV7-0002v2-TD for qemu-devel@nongnu.org; Thu, 16 Jul 2015 14:03:18 -0400 Received: by wgxm20 with SMTP id m20so64596818wgx.3 for ; Thu, 16 Jul 2015 11:03:17 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Thu, 16 Jul 2015 20:02:55 +0200 Message-Id: <1437069778-8954-6-git-send-email-pbonzini@redhat.com> In-Reply-To: <1437069778-8954-1-git-send-email-pbonzini@redhat.com> References: <1437069778-8954-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 5/8] RDMA: Fix error exits List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" 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 Signed-off-by: Dr. David Alan Gilbert Message-Id: <1436555332-19076-1-git-send-email-dgilbert@redhat.com> Signed-off-by: Paolo Bonzini --- 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); -- 2.4.3