aboutsummaryrefslogtreecommitdiff
path: root/hw/rdma/vmw/pvrdma_qp_ops.c
diff options
context:
space:
mode:
authorMarcel Apfelbaum <marcel.apfelbaum@gmail.com>2018-04-30 23:02:18 +0300
committerMarcel Apfelbaum <marcel.apfelbaum@gmail.com>2018-05-03 20:52:29 +0300
commitb0197cf80a903aa1e401cc7ebdf8be8bc307297b (patch)
tree0272945b6f0dbc5cb45fafc7bd8b12fba9227c6e /hw/rdma/vmw/pvrdma_qp_ops.c
parent1bad4957c8c4d5367961cb3d5287b2f25a1d6847 (diff)
hw/rdma: Fix possible usage of a NULL pointer
Coverity CID 1390586; The cq handle is provided by the guest and cannot be trusted to be previuosly allocated. Fix it by exiting the completion flow. 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-3-marcel.apfelbaum@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'hw/rdma/vmw/pvrdma_qp_ops.c')
-rw-r--r--hw/rdma/vmw/pvrdma_qp_ops.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/rdma/vmw/pvrdma_qp_ops.c b/hw/rdma/vmw/pvrdma_qp_ops.c
index 750ade6c31..99bb51111e 100644
--- a/hw/rdma/vmw/pvrdma_qp_ops.c
+++ b/hw/rdma/vmw/pvrdma_qp_ops.c
@@ -216,6 +216,7 @@ void pvrdma_cq_poll(RdmaDeviceResources *dev_res, uint32_t cq_handle)
cq = rdma_rm_get_cq(dev_res, cq_handle);
if (!cq) {
pr_dbg("Invalid CQ# %d\n", cq_handle);
+ return;
}
rdma_backend_poll_cq(dev_res, &cq->backend_cq);