Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5258284pxj; Wed, 26 May 2021 06:36:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfEhc3A1MV+W7rdRExv0ITKUw+VHQXCm9ahHN65to3Cw7RrtizKfM5uwXBUe9hm3It45gT X-Received: by 2002:aa7:d844:: with SMTP id f4mr36587020eds.203.1622036191529; Wed, 26 May 2021 06:36:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622036191; cv=none; d=google.com; s=arc-20160816; b=roAHnK99oBh4I1k6+LwYUFvuihwWA6Ogn5tU0wBGX1RbypaTYilreybkigE7VKpk3/ IcfvNN78cwf2i0sRkfTl0viYj7oCW/ELeyvVNudbblQqC+JGAmoXGr6XTvCQ6e9IQOIo bYfUgI3sNIO/cnTl5XYmrnx+XstrycSe6/z1KaNX703jK/uhkKJC9m8HjC36l4G6SqD4 42EADv9oKlp3tf/X/iHS4SI8xKj1KuSnve/+s1sO7KxtOlxHkovl42FYjkhg9OGPjMgh ySRFTNFOHNcaKFHZdEXlREKtWWnkKe3E1Bv8b27S+MFhkzF2/taKdt/+1+PzagNncc8M hckw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Jb3Z8YQiJXIHCxHdQR6bpLMBiPX+oY6Ogmx9bytHFZg=; b=Ct6GrJuWbPWId+NgdtuHHFf/YIq2zyD9nAsKn1mHqVlsW/KNRLshDpy6F01JSHwxQ6 W5K1eJeBrTqjAyyy/0qPXKhs0lshxNd9UeVVpFR7P9lau6zD1pRf/TvwuTZUKerYaLwc 6pkMmLo3BQrbCrrb5iMFSXw4Rg6AyYjhbCQfGG9Fje+GfYggddcaBy9R8CwVL/BWaXMr 0uAnegByw/hPo+wKXDpOcJUdmXKEhxUUGt+d8IscGuSZVci1Srm14V2QIbcHPnJQnMTY A2CLa/VdO8rZUZVQG14Gr9/LQpPl6dWcxHTrhMh3lcnc2H965q+ff57k1fcY+pyNORAk b20A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EvVo2ect; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mf21si685864ejb.50.2021.05.26.06.36.06; Wed, 26 May 2021 06:36:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EvVo2ect; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235105AbhEZNEB (ORCPT + 99 others); Wed, 26 May 2021 09:04:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235003AbhEZNCn (ORCPT ); Wed, 26 May 2021 09:02:43 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9E4DC061344 for ; Wed, 26 May 2021 06:01:09 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id z17so1041768wrq.7 for ; Wed, 26 May 2021 06:01:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Jb3Z8YQiJXIHCxHdQR6bpLMBiPX+oY6Ogmx9bytHFZg=; b=EvVo2ectQ9owwKk7Y/bcDbUANdvrdyNy+Bo8qjqFPN3hp+p5tqnmM/ZTHRFkAxmnLu zRMLaMQaC8SRDnvDEnogMxECQqs4qqg6IYn2DvCApUTGlZ3affwRK6s5AOy9sMM3AWte iXZ3pJunIwEEVyZQSm2oZhCHBv/zx7xUE/R+L8mncIao6jvSe9AQD7J+JsnodmxYm7BK usoRyCRnDUAzPd/R5rD804KwHEkiFOEehttu9iGTfu0cNC6WInb59jHRQ6lFg6GnYjIg Pr/0mkTZVVctHsLZaF/mhred28d73fN41aOlzBh84Fy4MTTXJ06KHKe7CZ6loLEUV8Qt KoWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Jb3Z8YQiJXIHCxHdQR6bpLMBiPX+oY6Ogmx9bytHFZg=; b=s5OE2JPkfavX/U7FPcfAgPaKJKehGQcKzSa+tjmwCIhwhMPKuomWzr6bSJ5NHKNSJH SEMmBi1YM3thFuF25NZEE0zaN93Q6jY0WTQwRpM6DQAjIK7lZQSmBm0UHX7h2pg1LAqV Y4xXJo8vSfMvjZJWegy6ivqaAn0Ac4HTdYXnfEgl57dQ5P8DrgzSYMWB0MFzPTBH9Qq1 PZzTqbIiS3DR7gThUBXq3m4RR/8/V/aE7J1LXgBy+GIQ3agMvofW7L6HPqliFFSMYR+O IJYzMqkdIEQH6gXojXTVOv0/08MU25d7mlK78qiT1U7rOGoEr2geFOgUtfa2PXpXOxo/ XUog== X-Gm-Message-State: AOAM530nW+jjjRxy3ZysUrKkJHmoHaDtB1kh/vFy4jc0tNlDzUuJK3Co oMUrYXHBcRrdb9/tnWnwBfqKow== X-Received: by 2002:adf:e411:: with SMTP id g17mr32218603wrm.402.1622034068386; Wed, 26 May 2021 06:01:08 -0700 (PDT) Received: from dell.default ([91.110.221.223]) by smtp.gmail.com with ESMTPSA id y14sm6430036wmj.37.2021.05.26.06.01.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 06:01:07 -0700 (PDT) From: Lee Jones To: lee.jones@linaro.org Cc: linux-kernel@vger.kernel.org, Mathias Nyman , Greg Kroah-Hartman , linux-usb@vger.kernel.org Subject: [PATCH 21/24] usb: host: xhci: Move array of structs from the stack onto the heap Date: Wed, 26 May 2021 14:00:34 +0100 Message-Id: <20210526130037.856068-22-lee.jones@linaro.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210526130037.856068-1-lee.jones@linaro.org> References: <20210526130037.856068-1-lee.jones@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fixes the following W=1 kernel build warning(s): drivers/usb/host/xhci.c: In function ‘xhci_reserve_bandwidth’: drivers/usb/host/xhci.c:2859:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=] Cc: Mathias Nyman Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Signed-off-by: Lee Jones --- drivers/usb/host/xhci.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index ac2a7d4288883..40ce4b4eb12ad 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -2773,7 +2773,7 @@ static int xhci_reserve_bandwidth(struct xhci_hcd *xhci, struct xhci_virt_device *virt_dev, struct xhci_container_ctx *in_ctx) { - struct xhci_bw_info ep_bw_info[31]; + struct xhci_bw_info *ep_bw_info; int i; struct xhci_input_control_ctx *ctrl_ctx; int old_active_eps = 0; @@ -2788,6 +2788,10 @@ static int xhci_reserve_bandwidth(struct xhci_hcd *xhci, return -ENOMEM; } + ep_bw_info = kzalloc(sizeof(*ep_bw_info) * 31, GFP_KERNEL); + if (!ep_bw_info) + return -ENOMEM; + for (i = 0; i < 31; i++) { if (!EP_IS_ADDED(ctrl_ctx, i) && !EP_IS_DROPPED(ctrl_ctx, i)) continue; @@ -2824,6 +2828,7 @@ static int xhci_reserve_bandwidth(struct xhci_hcd *xhci, * Update the number of active TTs. */ xhci_update_tt_active_eps(xhci, virt_dev, old_active_eps); + kfree(ep_bw_info); return 0; } @@ -2855,6 +2860,7 @@ static int xhci_reserve_bandwidth(struct xhci_hcd *xhci, &virt_dev->eps[i], virt_dev->tt_info); } + kfree(ep_bw_info); return -ENOMEM; } -- 2.31.1