migration/rdma: Check qemu_rdma_init_one_block
PATCH 1/1 migration/rdma: Check qemu_rdma_init_one_block
From: "Dr. David Alan Gilbert" <[email protected]>
Actually it can't fail at the moment, but Coverity moans that it's the only place it's not checked, and it's an easy check.
Reported-by Coverity (CID 1399413)
Signed-off-by Dr. David Alan Gilbert <[email protected]>
--- migration/rdma.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
migration/rdma.c +5 -1
@@ -641,10 +641,14 @@ static int qemu_rdma_init_one_block(RAMBlock *rb, void *opaque)static int qemu_rdma_init_ram_blocks (RDMAContext *rdma) {RDMALocalBlocks *local = &rdma->local_ram_blocks; +int ret;assert (rdma->blockmap ==NULL );memset (local,0 ,sizeof *local); -foreach_not_ignored_block (qemu_rdma_init_one_block, rdma); + ret =foreach_not_ignored_block (qemu_rdma_init_one_block, rdma); +if (ret) { +return ret; + }trace_qemu_rdma_init_ram_blocks (local->nb_blocks); rdma->dest_blocks =g_new0 (RDMADestBlock, rdma->local_ram_blocks.nb_blocks);
Signature · 1 line
2.20.1
Quoted 7 lines · Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" <[email protected]>
Actually it can't fail at the moment, but Coverity moans that it's the only place it's not checked, and it's an easy check.
Reported-by Coverity (CID 1399413)Signed-off-by Dr. David Alan Gilbert <[email protected]>
Reviewed-by Peter Xu <[email protected]>
Signature · 1 line
Peter Xu