diff mbox

IB/core: Allocating larger memory than required for cma_configfs

Message ID 1451484858-1530-1-git-send-email-matanb@mellanox.com (mailing list archive)
State Superseded
Headers show

Commit Message

Matan Barak Dec. 30, 2015, 2:14 p.m. UTC
We were allocating larger memory space than requried for
cma_dev_group->default_ports_group.

Fixes: 045959db65c6 ('IB/cma: Add configfs for rdma_cm')
Signed-off-by: Matan Barak <matanb@mellanox.com>
---
Hi Doug,

This patch fixes a small issue, where we allocated more space than we
actually needed. This was introduces in the RoCE v2 series.

Regards,
Matan

 drivers/infiniband/core/cma_configfs.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Bart Van Assche Dec. 31, 2015, 7:50 a.m. UTC | #1
On 12/30/2015 03:14 PM, Matan Barak wrote:
> We were allocating larger memory space than requried for
> cma_dev_group->default_ports_group.

Please change the subject into something like "Do not allocate more 
...". Please also fix the spelling error in the patch description.

Thanks,

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Matan Barak Dec. 31, 2015, 8:50 a.m. UTC | #2
On Thu, Dec 31, 2015 at 9:50 AM, Bart Van Assche
<bart.vanassche@sandisk.com> wrote:
> On 12/30/2015 03:14 PM, Matan Barak wrote:
>>
>> We were allocating larger memory space than requried for
>> cma_dev_group->default_ports_group.
>
>
> Please change the subject into something like "Do not allocate more ...".
> Please also fix the spelling error in the patch description.
>

No problem, I'll fix and send V1.

> Thanks,
>
> Bart.
>

Regards,
Matan

> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/core/cma_configfs.c b/drivers/infiniband/core/cma_configfs.c
index bd1d640..ab554df 100644
--- a/drivers/infiniband/core/cma_configfs.c
+++ b/drivers/infiniband/core/cma_configfs.c
@@ -169,9 +169,10 @@  static int make_cma_ports(struct cma_dev_group *cma_dev_group,
 	ports = kcalloc(ports_num, sizeof(*cma_dev_group->ports),
 			GFP_KERNEL);
 
-	cma_dev_group->default_ports_group = kcalloc(ports_num + 1,
-						     sizeof(*cma_dev_group->ports),
-						     GFP_KERNEL);
+	cma_dev_group->default_ports_group =
+		kcalloc(ports_num + 1,
+			sizeof(*cma_dev_group->default_ports_group),
+			GFP_KERNEL);
 
 	if (!ports || !cma_dev_group->default_ports_group) {
 		err = -ENOMEM;