From patchwork Mon Aug 25 00:32:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 35890 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DFACA203C0 for ; Mon, 25 Aug 2014 10:02:23 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id v10sf102893716pde.6 for ; Mon, 25 Aug 2014 03:02:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:date :message-id:subject:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=UmE5juP0j3fpzIr3mPWiQFqq65O+O4efrNs/6XUiuYU=; b=i3SE4qVumB3AqQ6PZXOFvSNAwFtAKwQVC8Ouht+gC0cAyKAtFQyCM9kazIl/qWd9pt 3LRj7bTfZ8Oi9Eg5VYKBdbV8JdFZAU87OvQS3c6nR7dZAkeIZKGnEuyZPUBzE6/oaRoa OXIIIMF1vlR3Ukh829DZuPZLmG3VqJu/fYIVZtExGkFCZDz68bY8DIhIeKjzqCEbpO6A SPAM9TXeoT+QlEphLmcDWmpiYnho6bchySf7ZrPI7Oj+4APeSjyARZZEZhLwesFB1OLx sT3E6R6GnJIfIWT9TmgNCZm1xP0gSKVJmLs0x3cjZWxVuPUxS4sbg+LqZJGBvdpby3sY 0CLA== X-Gm-Message-State: ALoCoQnDqU8/wh4yZlkFIzccw6BBdFJVfHsYuYzzp7iQDiWwz1yrALh5IFvxUHRma4vTe1qIWzD1 X-Received: by 10.66.66.46 with SMTP id c14mr13801675pat.21.1408960942206; Mon, 25 Aug 2014 03:02:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.32.138 with SMTP id h10ls585228qgh.87.gmail; Mon, 25 Aug 2014 03:02:22 -0700 (PDT) X-Received: by 10.53.3.169 with SMTP id bx9mr389039vdd.80.1408960942107; Mon, 25 Aug 2014 03:02:22 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id gt5si17113739vdc.14.2014.08.25.03.02.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Aug 2014 03:02:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id hy10so14865773vcb.18 for ; Mon, 25 Aug 2014 03:02:21 -0700 (PDT) X-Received: by 10.220.187.134 with SMTP id cw6mr114863vcb.71.1408960941850; Mon, 25 Aug 2014 03:02:21 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp104637vcb; Mon, 25 Aug 2014 03:02:21 -0700 (PDT) X-Received: by 10.69.31.234 with SMTP id kp10mr9775538pbd.138.1408960940972; Mon, 25 Aug 2014 03:02:20 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rf10si52660568pab.76.2014.08.25.03.02.17 for ; Mon, 25 Aug 2014 03:02:18 -0700 (PDT) Received-SPF: none (google.com: netdev-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755077AbaHYKCM (ORCPT + 3 others); Mon, 25 Aug 2014 06:02:12 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:60184 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753344AbaHYKCL (ORCPT ); Mon, 25 Aug 2014 06:02:11 -0400 Received: from cpc11-sgyl31-2-0-cust672.sgyl.cable.virginm.net ([94.175.94.161] helo=finisterre) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1XLr69-0005AM-CS; Mon, 25 Aug 2014 10:02:05 +0000 Received: from broonie by finisterre with local (Exim 4.84_RC1) (envelope-from ) id 1XLiD7-0003Ce-0G; Sun, 24 Aug 2014 19:32:37 -0500 From: Mark Brown To: Chien Yen , "David S. Miller" Cc: rds-devel@oss.oracle.com, netdev@vger.kernel.org, linaro-kernel@lists.linaro.org, Mark Brown Date: Sun, 24 Aug 2014 19:32:35 -0500 Message-Id: <1408926755-12277-1-git-send-email-broonie@kernel.org> X-Mailer: git-send-email 2.1.0.rc1 X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mezzanine.sirena.org.uk X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.2 Subject: [PATCH] net: rds: Don't allocate rds_sock on stack X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: netdev-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: netdev@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: broonie@kernel.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mark Brown struct rds_sock is rather large ausing the following warning in an ARM allmodconfig: net/rds/iw_rdma.c:200:1: warning: the frame size of 1056 bytes is larger than 1024 bytes [-Wframe-larger-than=] Fix this by dynamically allocating struct rds_sock in rds_iw_update_cm_id instead of allocating it on the stack. Signed-off-by: Mark Brown --- net/rds/iw_rdma.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/net/rds/iw_rdma.c b/net/rds/iw_rdma.c index a817705..cee5daa 100644 --- a/net/rds/iw_rdma.c +++ b/net/rds/iw_rdma.c @@ -180,22 +180,28 @@ int rds_iw_update_cm_id(struct rds_iw_device *rds_iwdev, struct rdma_cm_id *cm_i { struct sockaddr_in *src_addr, *dst_addr; struct rds_iw_device *rds_iwdev_old; - struct rds_sock rs; + struct rds_sock *rs; struct rdma_cm_id *pcm_id; int rc; + rs = kzalloc(sizeof(*rs), GFP_KERNEL); + if (!rs) + return -ENOMEM; + src_addr = (struct sockaddr_in *)&cm_id->route.addr.src_addr; dst_addr = (struct sockaddr_in *)&cm_id->route.addr.dst_addr; - rs.rs_bound_addr = src_addr->sin_addr.s_addr; - rs.rs_bound_port = src_addr->sin_port; - rs.rs_conn_addr = dst_addr->sin_addr.s_addr; - rs.rs_conn_port = dst_addr->sin_port; + rs->rs_bound_addr = src_addr->sin_addr.s_addr; + rs->rs_bound_port = src_addr->sin_port; + rs->rs_conn_addr = dst_addr->sin_addr.s_addr; + rs->rs_conn_port = dst_addr->sin_port; - rc = rds_iw_get_device(&rs, &rds_iwdev_old, &pcm_id); + rc = rds_iw_get_device(rs, &rds_iwdev_old, &pcm_id); if (rc) rds_iw_remove_cm_id(rds_iwdev, cm_id); + kfree(rs); + return rds_iw_add_cm_id(rds_iwdev, cm_id); }