* [Qemu-devel] [PATCH] hw/pvrdma: Check the correct return value
@ 2018-10-25 6:17 Yuval Shaia
2018-10-29 8:57 ` Marcel Apfelbaum
0 siblings, 1 reply; 2+ messages in thread
From: Yuval Shaia @ 2018-10-25 6:17 UTC (permalink / raw)
To: yuval.shaia, marcel.apfelbaum, qemu-devel
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>
---
hw/rdma/vmw/pvrdma_cmd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/rdma/vmw/pvrdma_cmd.c b/hw/rdma/vmw/pvrdma_cmd.c
index 4faeb21631..57d6f41ae6 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);
}
--
2.17.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] hw/pvrdma: Check the correct return value
2018-10-25 6:17 [Qemu-devel] [PATCH] hw/pvrdma: Check the correct return value Yuval Shaia
@ 2018-10-29 8:57 ` Marcel Apfelbaum
0 siblings, 0 replies; 2+ messages in thread
From: Marcel Apfelbaum @ 2018-10-29 8:57 UTC (permalink / raw)
To: Yuval Shaia, qemu-devel
On 10/25/18 9:17 AM, Yuval Shaia wrote:
> 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>
> ---
> hw/rdma/vmw/pvrdma_cmd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/rdma/vmw/pvrdma_cmd.c b/hw/rdma/vmw/pvrdma_cmd.c
> index 4faeb21631..57d6f41ae6 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);
> }
>
Reviewed-by: Marcel Apfelbaum<marcel.apfelbaum@gmail.com>
Thanks,
Marcel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-29 7:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-25 6:17 [Qemu-devel] [PATCH] hw/pvrdma: Check the correct return value Yuval Shaia
2018-10-29 8:57 ` Marcel Apfelbaum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).