mlx4u.dll: initialize qp pointer before use
authorshefty <shefty@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 20 Jan 2009 21:35:44 +0000 (21:35 +0000)
committershefty <shefty@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 20 Jan 2009 21:35:44 +0000 (21:35 +0000)
We need to initialize the qp pointer to NULL to avoid accessing some random memory location when polling for completions.  Without this, calls to mlx4_poll_cq_array() can crash in mlx4_poll_one().

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@1859 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

hw/mlx4/user/hca/cq.c

index a95e183..a224ebb 100644 (file)
@@ -348,7 +348,7 @@ int mlx4_poll_cq_array(const void* h_cq,
                        const int num_entries, uvp_wc_t* const wc)\r
 {\r
        struct mlx4_cq *cq = to_mcq((struct ibv_cq *)/*Ptr64ToPtr(*/ h_cq /*)*/);\r
-       struct mlx4_qp *qp;\r
+       struct mlx4_qp *qp = NULL;\r
        int ne;\r
        int err = CQ_EMPTY;\r
 \r