IB/cma: allocating too much memory in make_cma_ports()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 12 Jan 2016 09:29:21 +0000 (12:29 +0300)
committerDoug Ledford <dledford@redhat.com>
Tue, 19 Jan 2016 20:17:40 +0000 (15:17 -0500)
commita7d0e959fab832d0614d0e144cb01cbb87d36258
treea09da7b5ad6582f5d1effa8b2691b0041cb5c688
parentbc1251e6d9420fec4c6b328bcf9ea4e5bdecd30d
IB/cma: allocating too much memory in make_cma_ports()

The issue here is that there is a cut and paste bug.  When we allocate
cma_dev_group->default_ports_group we use "sizeof(*cma_dev_group->ports)"
instead of "sizeof(*cma_dev_group->default_ports_group)".

We're bumping up against the 80 character limit so I introduced a new
local pointer "ports_group" to get around that.

Fixes: 045959db65c6 ('IB/cma: Add configfs for rdma_cm')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/cma_configfs.c