[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/7] hw/rdma: Fix possible munmap call on a NULL poi
From: |
Marcel Apfelbaum |
Subject: |
[Qemu-devel] [PATCH 1/7] hw/rdma: Fix possible munmap call on a NULL pointer |
Date: |
Mon, 30 Apr 2018 23:02:17 +0300 |
Coverity CID 1390620: we call munmap() on a NULL pointer.
Reported-by: Peter Maydell <address@hidden>
Signed-off-by: Marcel Apfelbaum <address@hidden>
Reviewed-by: Yuval Shaia <address@hidden>
---
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 99019d8741..f9dd78cb27 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 (!resp->hdr.err) {
+ if (host_virt && !resp->hdr.err) {
munmap(host_virt, cmd->length);
}
--
2.14.3
- [Qemu-devel] [PATCH 0/7] hw/rdma: coverity fixes, Marcel Apfelbaum, 2018/04/30
- [Qemu-devel] [PATCH 1/7] hw/rdma: Fix possible munmap call on a NULL pointer,
Marcel Apfelbaum <=
- [Qemu-devel] [PATCH 3/7] hw/rdma: Delete port's pkey table, Marcel Apfelbaum, 2018/04/30
- [Qemu-devel] [PATCH 4/7] hw/rdma: Fix possible out of bounds access to GID table, Marcel Apfelbaum, 2018/04/30
- [Qemu-devel] [PATCH 2/7] hw/rdma: Fix possible usage of a NULL pointer, Marcel Apfelbaum, 2018/04/30
- [Qemu-devel] [PATCH 5/7] hw/rdma: Fix possible out of bounds access to regs array, Marcel Apfelbaum, 2018/04/30
- [Qemu-devel] [PATCH 6/7] hw/rdma: Delete duplicate definition of MAX_RM_TBL_NAME, Marcel Apfelbaum, 2018/04/30
- [Qemu-devel] [PATCH 7/7] hw/rdma: Fix possible out of bounds access to port GID index, Marcel Apfelbaum, 2018/04/30