]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
RDMA/cma: Initialize rdma_bind_list in cma_alloc_any_port()
authorSean Hefty <sean.hefty@intel.com>
Mon, 5 Mar 2007 20:50:17 +0000 (12:50 -0800)
committerRoland Dreier <rolandd@cisco.com>
Tue, 6 Mar 2007 20:41:44 +0000 (12:41 -0800)
The struct rdma_bind_list fields for hlist are not being initialized,
resulting in a corrupted list.  Fix this by using kzalloc() to make
sure all pointers are NULL.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/core/cma.c

index d441815a3e0c908588b55ee9d271b11e7eff5791..fde92ce45153efc7eeb6a2cfc3f46e71bb9df82b 100644 (file)
@@ -1821,7 +1821,7 @@ static int cma_alloc_port(struct idr *ps, struct rdma_id_private *id_priv,
        struct rdma_bind_list *bind_list;
        int port, ret;
 
-       bind_list = kmalloc(sizeof *bind_list, GFP_KERNEL);
+       bind_list = kzalloc(sizeof *bind_list, GFP_KERNEL);
        if (!bind_list)
                return -ENOMEM;