RDMA: Fix error exits

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 <dgilbert@redhat.com>
Message-Id: <1436555332-19076-1-git-send-email-dgilbert@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Dr. David Alan Gilbert 2015-07-10 20:08:52 +01:00 committed by Paolo Bonzini
parent 5348c62cab
commit 24b41d66c8

View File

@ -2997,7 +2997,7 @@ static int qemu_rdma_registration_handle(QEMUFile *f, void *opaque)
(unsigned int)comp->block_idx, (unsigned int)comp->block_idx,
rdma->local_ram_blocks.nb_blocks); rdma->local_ram_blocks.nb_blocks);
ret = -EIO; ret = -EIO;
break; goto out;
} }
block = &(rdma->local_ram_blocks.block[comp->block_idx]); 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, (unsigned int)reg->current_index,
rdma->local_ram_blocks.nb_blocks); rdma->local_ram_blocks.nb_blocks);
ret = -ENOENT; ret = -ENOENT;
break; goto out;
} }
block = &(rdma->local_ram_blocks.block[reg->current_index]); block = &(rdma->local_ram_blocks.block[reg->current_index]);
if (block->is_ram_block) { if (block->is_ram_block) {
@ -3102,7 +3102,7 @@ static int qemu_rdma_registration_handle(QEMUFile *f, void *opaque)
block->block_name, block->offset, block->block_name, block->offset,
reg->key.current_addr); reg->key.current_addr);
ret = -ERANGE; ret = -ERANGE;
break; goto out;
} }
host_addr = (block->local_host_addr + host_addr = (block->local_host_addr +
(reg->key.current_addr - block->offset)); (reg->key.current_addr - block->offset));
@ -3118,7 +3118,7 @@ static int qemu_rdma_registration_handle(QEMUFile *f, void *opaque)
" chunk: %" PRIx64, " chunk: %" PRIx64,
block->block_name, reg->key.chunk); block->block_name, reg->key.chunk);
ret = -ERANGE; ret = -ERANGE;
break; goto out;
} }
} }
chunk_start = ram_chunk_start(block, chunk); chunk_start = ram_chunk_start(block, chunk);