Skip to content

Commit

Permalink
hw/pvrdma: Check the correct return value
Browse files Browse the repository at this point in the history
Return value of 0 means ok, we want to free the memory only in case of
error.

Signed-off-by: Yuval Shaia <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Marcel Apfelbaum<[email protected]>
Signed-off-by: Marcel Apfelbaum <[email protected]>
  • Loading branch information
Yuval Shaia authored and marcel-apf committed Dec 22, 2018
1 parent 891ff9f commit dee2e53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/rdma/vmw/pvrdma_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit dee2e53

Please sign in to comment.