From: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
To: qemu-devel@nongnu.org
Cc: marcel.apfelbaum@gmail.com, yuval.shaia@oracle.com,
peter.maydell@linaro.org, f4bug@amsat.org
Subject: [Qemu-devel] [PULL 1/8] hw/rdma: Fix possible munmap call on a NULL pointer
Date: Thu, 3 May 2018 21:21:18 +0300 [thread overview]
Message-ID: <20180503182125.20310-2-marcel.apfelbaum@gmail.com> (raw)
In-Reply-To: <20180503182125.20310-1-marcel.apfelbaum@gmail.com>
Coverity CID 1390620: we call munmap() on a NULL pointer.
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Message-Id: <20180430200223.4119-2-marcel.apfelbaum@gmail.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 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
next prev parent reply other threads:[~2018-05-03 18:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-03 18:21 [Qemu-devel] [PULL 0/8] RDMA queue Marcel Apfelbaum
2018-05-03 18:21 ` Marcel Apfelbaum [this message]
2018-05-03 18:21 ` [Qemu-devel] [PULL 2/8] hw/rdma: Fix possible usage of a NULL pointer Marcel Apfelbaum
2018-05-03 18:21 ` [Qemu-devel] [PULL 3/8] hw/rdma: Delete port's pkey table Marcel Apfelbaum
2018-05-03 18:21 ` [Qemu-devel] [PULL 4/8] hw/rdma: Fix possible out of bounds access to GID table Marcel Apfelbaum
2018-05-03 18:21 ` [Qemu-devel] [PULL 5/8] hw/rdma: Fix possible out of bounds access to regs array Marcel Apfelbaum
2018-05-03 18:21 ` [Qemu-devel] [PULL 6/8] hw/rdma: Delete duplicate definition of MAX_RM_TBL_NAME Marcel Apfelbaum
2018-05-03 18:21 ` [Qemu-devel] [PULL 7/8] hw/rdma: Fix possible out of bounds access to port GID index Marcel Apfelbaum
2018-05-03 18:21 ` [Qemu-devel] [PULL 8/8] MAINTAINERS: update Marcel Apfelbaum email Marcel Apfelbaum
2018-05-04 8:24 ` [Qemu-devel] [PULL 0/8] RDMA queue Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180503182125.20310-2-marcel.apfelbaum@gmail.com \
--to=marcel.apfelbaum@gmail.com \
--cc=f4bug@amsat.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=yuval.shaia@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).