Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967187AbbLPWem (ORCPT ); Wed, 16 Dec 2015 17:34:42 -0500 Received: from mail-wm0-f43.google.com ([74.125.82.43]:36094 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932914AbbLPWel (ORCPT ); Wed, 16 Dec 2015 17:34:41 -0500 Date: Wed, 16 Dec 2015 21:15:34 +0000 From: Okash Khawaja To: gregkh@linuxfoundation.org Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: rtl8192u: fix large frame size compiler warning Message-ID: <20151216211534.GA13478@bytefire-computer> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20151216205545.GA12609@bytefire-computer> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2541 Lines: 69 This patch fixes following compiler warning: drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c: In function ‘RxReorderIndicatePacket’: drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:758:1: warning: the frame size of 1064 bytes is larger than 1024 bytes [-Wframe-larger-than=] It replaces the statically allocated array prxbIndicateArray with a kmalloc'd one. Signed-off-by: Okash Khawaja --- drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c index 130c852..77eed52 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c @@ -594,12 +594,22 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee, { PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; PRX_REORDER_ENTRY pReorderEntry = NULL; - struct ieee80211_rxb *prxbIndicateArray[REORDER_WIN_SIZE]; + struct ieee80211_rxb **prxbIndicateArray; u8 WinSize = pHTInfo->RxReorderWinSize; u16 WinEnd = (pTS->RxIndicateSeq + WinSize -1)%4096; u8 index = 0; bool bMatchWinStart = false, bPktInBuf = false; IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): Seq is %d,pTS->RxIndicateSeq is %d, WinSize is %d\n",__func__,SeqNum,pTS->RxIndicateSeq,WinSize); + + prxbIndicateArray = kmalloc(sizeof(struct ieee80211_rxb *) * + REORDER_WIN_SIZE, GFP_KERNEL); + if (!prxbIndicateArray) { + IEEE80211_DEBUG(IEEE80211_DL_ERR, + "%s(): kmalloc prxbIndicateArray error\n", + __func__); + return; + } + /* Rx Reorder initialize condition.*/ if (pTS->RxIndicateSeq == 0xffff) { pTS->RxIndicateSeq = SeqNum; @@ -618,6 +628,8 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee, kfree(prxb); prxb = NULL; } + + kfree(prxbIndicateArray); return; } @@ -741,6 +753,7 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee, // Indicate packets if(index>REORDER_WIN_SIZE){ IEEE80211_DEBUG(IEEE80211_DL_ERR, "RxReorderIndicatePacket(): Rx Reorer buffer full!! \n"); + kfree(prxbIndicateArray); return; } ieee80211_indicate_packets(ieee, prxbIndicateArray, index); -- 2.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/