All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V1] IB/core: Do not allocate more memory than required for cma_configfs
@ 2015-12-31  8:49 Matan Barak
       [not found] ` <1451551743-26042-1-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Matan Barak @ 2015-12-31  8:49 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Or Gerlitz, Majd Dibbiny,
	Moni Shoua, Bart Van Assche, Matan Barak

We were allocating larger memory space than required for
cma_dev_group->default_ports_group.

Fixes: 045959db65c6 ('IB/cma: Add configfs for rdma_cm')
Signed-off-by: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
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

Changes from V0:
 - Change subject and fix spelling mistake in commit message

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

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;
-- 
2.1.0

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-01-20  8:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-31  8:49 [PATCH V1] IB/core: Do not allocate more memory than required for cma_configfs Matan Barak
     [not found] ` <1451551743-26042-1-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-01-19 21:14   ` Doug Ledford
     [not found]     ` <569EA730.2020205-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-01-20  8:20       ` Matan Barak (External)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.