Skip to content

Commit

Permalink
RDMA/cma: Initialize rdma_bind_list in cma_alloc_any_port()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sean Hefty authored and Roland Dreier committed Mar 6, 2007
1 parent aeb100e commit cb164b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/core/cma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit cb164b8

Please sign in to comment.