[MLX4] Fixed QP memory leak, inserted in 1288 fix.
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 27 Nov 2008 13:25:33 +0000 (13:25 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 27 Nov 2008 13:25:33 +0000 (13:25 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@1771 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

hw/mlx4/kernel/bus/ib/cq.c

index 2cedea6..8b05a8a 100644 (file)
@@ -145,7 +145,7 @@ struct ib_cq *mlx4_ib_create_cq(struct ib_device *ibdev, int entries, int vector
        buf_size     = entries * sizeof (struct mlx4_cqe);\r
        spin_lock_init(&cq->lock);\r
 \r
-       if (context) {\r
+       if (context && udata) {\r
                struct mlx4_ib_create_cq ucmd;\r
 \r
                if (ib_copy_from_udata(&ucmd, udata, sizeof ucmd)) {\r
@@ -279,10 +279,11 @@ static void dump_cqe(void *cqe)
 {\r
        __be32 *buf = cqe;\r
 \r
-       printk(KERN_DEBUG "CQE contents %08x %08x %08x %08x %08x %08x %08x %08x\n",\r
-              be32_to_cpu(buf[0]), be32_to_cpu(buf[1]), be32_to_cpu(buf[2]),\r
-              be32_to_cpu(buf[3]), be32_to_cpu(buf[4]), be32_to_cpu(buf[5]),\r
-              be32_to_cpu(buf[6]), be32_to_cpu(buf[7]));\r
+       MLX4_PRINT(TRACE_LEVEL_ERROR, MLX4_DBG_DRV, \r
+               (KERN_DEBUG "CQE contents %08x %08x %08x %08x %08x %08x %08x %08x\n",\r
+                          be32_to_cpu(buf[0]), be32_to_cpu(buf[1]), be32_to_cpu(buf[2]),\r
+                          be32_to_cpu(buf[3]), be32_to_cpu(buf[4]), be32_to_cpu(buf[5]),\r
+                          be32_to_cpu(buf[6]), be32_to_cpu(buf[7])));\r
 }\r
 \r
 static void mlx4_ib_handle_error_cqe(struct mlx4_err_cqe *cqe,\r