From: Sean Hefty Date: Mon, 5 Mar 2007 20:50:17 +0000 (-0800) Subject: RDMA/cma: Initialize rdma_bind_list in cma_alloc_any_port() X-Git-Tag: v2.6.21-rc4~79^2~9 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb164b8c6a2bdf995c938e5f157d41465b18e5c3;p=linux-2.6 RDMA/cma: Initialize rdma_bind_list in cma_alloc_any_port() 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 Signed-off-by: Roland Dreier --- diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index d441815a3e..fde92ce451 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c @@ -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;