mirror of
https://github.com/torvalds/linux.git
synced 2024-12-04 01:51:34 +00:00
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 <sean.hefty@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
This commit is contained in:
parent
aeb100e246
commit
cb164b8c6a
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user