net: rds: drop VLA in rds_for_each_conn_info()

Avoid VLA[1] by using an already allocated buffer passed
by the caller.

[1] https://lkml.org/lkml/2018/3/7/621

Signed-off-by: Salvatore Mesoraca <s.mesoraca16@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Salvatore Mesoraca
2018-03-11 22:07:49 +01:00
committed by David S. Miller
parent 3ed898e8cd
commit f1cb9d68b4
3 changed files with 5 additions and 1 deletions

View File

@@ -321,8 +321,11 @@ static void rds_ib_ic_info(struct socket *sock, unsigned int len,
struct rds_info_iterator *iter,
struct rds_info_lengths *lens)
{
u64 buffer[(sizeof(struct rds_info_rdma_connection) + 7) / 8];
rds_for_each_conn_info(sock, len, iter, lens,
rds_ib_conn_info_visitor,
buffer,
sizeof(struct rds_info_rdma_connection));
}