提交 dee2e53c 编写于 作者: Y Yuval Shaia 提交者: Marcel Apfelbaum

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: NYuval 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: NMarcel Apfelbaum <marcel.apfelbaum@gmail.com>
上级 891ff9f4
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册