From patchwork Wed Dec 30 14:14:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matan Barak X-Patchwork-Id: 7933721 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B482B9F32E for ; Wed, 30 Dec 2015 14:17:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E01C6202C8 for ; Wed, 30 Dec 2015 14:17:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0EFE120274 for ; Wed, 30 Dec 2015 14:17:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751946AbbL3ORS (ORCPT ); Wed, 30 Dec 2015 09:17:18 -0500 Received: from [193.47.165.129] ([193.47.165.129]:40665 "EHLO mellanox.co.il" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751779AbbL3ORS (ORCPT ); Wed, 30 Dec 2015 09:17:18 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from matanb@mellanox.com) with ESMTPS (AES256-SHA encrypted); 30 Dec 2015 16:16:50 +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 tBUEGnZx005588; Wed, 30 Dec 2015 16:16:49 +0200 From: Matan Barak To: Doug Ledford Cc: linux-rdma@vger.kernel.org, Or Gerlitz , Majd Dibbiny , Moni Shoua , Matan Barak Subject: [PATCH] IB/core: Allocating larger memory than required for cma_configfs Date: Wed, 30 Dec 2015 16:14:16 +0200 Message-Id: <1451484858-1530-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 requried 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 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;