From patchwork Thu Dec 31 08:49:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matan Barak X-Patchwork-Id: 7935701 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4CDFBBEEE5 for ; Thu, 31 Dec 2015 08:53:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 765FF20263 for ; Thu, 31 Dec 2015 08:53:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 556F420265 for ; Thu, 31 Dec 2015 08:53:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752334AbbLaIwS (ORCPT ); Thu, 31 Dec 2015 03:52:18 -0500 Received: from [193.47.165.129] ([193.47.165.129]:50060 "EHLO mellanox.co.il" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1755300AbbLaIwQ (ORCPT ); Thu, 31 Dec 2015 03:52:16 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from matanb@mellanox.com) with ESMTPS (AES256-SHA encrypted); 31 Dec 2015 10:51:53 +0200 Received: from rsws33.mtr.labs.mlnx (dev-r-vrt-064.mtr.labs.mlnx [10.212.64.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id tBV8pqvf011537; Thu, 31 Dec 2015 10:51:53 +0200 From: Matan Barak To: Doug Ledford Cc: linux-rdma@vger.kernel.org, Or Gerlitz , Majd Dibbiny , Moni Shoua , Bart Van Assche , Matan Barak Subject: [PATCH V1] IB/core: Do not allocate more memory than required for cma_configfs Date: Thu, 31 Dec 2015 10:49:03 +0200 Message-Id: <1451551743-26042-1-git-send-email-matanb@mellanox.com> X-Mailer: git-send-email 2.1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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;