aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorYuval Shaia <yuval.shaia@oracle.com>2018-10-25 09:17:00 +0300
committerMarcel Apfelbaum <marcel.apfelbaum@gmail.com>2018-12-22 11:09:56 +0200
commitdee2e53c86de37dea4f36936eab5a6aef340b8f8 (patch)
tree3012d9228baf7db77de63587fbd7bba9fdd34d3e /hw
parent891ff9f4a371da2dbd5244590eb35e8d803e18d8 (diff)
downloadqemu-dee2e53c86de37dea4f36936eab5a6aef340b8f8.zip
qemu-dee2e53c86de37dea4f36936eab5a6aef340b8f8.tar.gz
qemu-dee2e53c86de37dea4f36936eab5a6aef340b8f8.tar.bz2
hw/pvrdma: Check the correct return value
Return value of 0 means ok, we want to free the memory only in case of error. Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com> Message-Id: <20181025061700.17050-1-yuval.shaia@oracle.com> Reviewed-by: Marcel Apfelbaum<marcel.apfelbaum@gmail.com> Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/rdma/vmw/pvrdma_cmd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/rdma/vmw/pvrdma_cmd.c b/hw/rdma/vmw/pvrdma_cmd.c
index 4faeb21..57d6f41 100644
--- a/hw/rdma/vmw/pvrdma_cmd.c
+++ b/hw/rdma/vmw/pvrdma_cmd.c
@@ -232,7 +232,7 @@ static int create_mr(PVRDMADev *dev, union pvrdma_cmd_req *req,
cmd->start, cmd->length, host_virt,
cmd->access_flags, &resp->mr_handle,
&resp->lkey, &resp->rkey);
- if (host_virt && !resp->hdr.err) {
+ if (resp->hdr.err && host_virt) {
munmap(host_virt, cmd->length);
}