summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8192e/rtllib_rx.c
diff options
context:
space:
mode:
authorLarry Finger <Larry.Finger@lwfinger.net>2011-09-01 17:23:20 (GMT)
committerGreg Kroah-Hartman <gregkh@suse.de>2011-09-06 23:35:59 (GMT)
commit2eed3dee92453c1798f0932613b1b66f0763ab2e (patch)
tree44ff25dc51f603186073ff85bed655b70fde6e48 /drivers/staging/rtl8192e/rtllib_rx.c
parent52a7fb0951b35840a79a5b162fb853b78cec3c09 (diff)
downloadlinux-fsl-qoriq-2eed3dee92453c1798f0932613b1b66f0763ab2e.tar.xz
staging: rtl8192e: Fix smatch warnings regarding large arrays on stack
Smatch reports the follwing warnings: CHECK drivers/staging/rtl8192e/rtllib_rx.c drivers/staging/rtl8192e/rtllib_rx.c +552 RxReorderIndicatePacket(6) warn: 'prxbIndicateArray' puts 1024 bytes on stack CHECK drivers/staging/rtl8192e/rtl819x_TSProc.c drivers/staging/rtl8192e/rtl819x_TSProc.c +40 RxPktPendingTimeout(9) warn: 'stats_IndicateArray' puts 1024 bytes on stack CHECK drivers/staging/rtl8192e/r8192E_phy.c drivers/staging/rtl8192e/r8192E_phy.c +859 rtl8192_phy_SwChnlStepByStep(11) warn: function puts 797 bytes on stack CHECK drivers/staging/rtl8192e/rtllib_rx.c drivers/staging/rtl8192e/rtllib_rx.c +552 RxReorderIndicatePacket(6) warn: 'prxbIndicateArray' puts 1024 bytes on stack These are fixed by adding the arrays in question as a union in a struct used by nearly all routines. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/rtl8192e/rtllib_rx.c')
-rw-r--r--drivers/staging/rtl8192e/rtllib_rx.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index 745ae08..8d0af5e 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -520,7 +520,6 @@ void rtllib_indicate_packets(struct rtllib_device *ieee, struct rtllib_rxb **prx
void rtllib_FlushRxTsPendingPkts(struct rtllib_device *ieee, struct rx_ts_record *pTS)
{
struct rx_reorder_entry *pRxReorderEntry;
- struct rtllib_rxb *RfdArray[REORDER_WIN_SIZE];
u8 RfdCnt = 0;
del_timer_sync(&pTS->RxPktPendingTimer);
@@ -534,12 +533,12 @@ void rtllib_FlushRxTsPendingPkts(struct rtllib_device *ieee, struct rx_ts_record
RTLLIB_DEBUG(RTLLIB_DL_REORDER, "%s(): Indicate SeqNum %d!\n", __func__, pRxReorderEntry->SeqNum);
list_del_init(&pRxReorderEntry->List);
- RfdArray[RfdCnt] = pRxReorderEntry->prxb;
+ ieee->RfdArray[RfdCnt] = pRxReorderEntry->prxb;
RfdCnt = RfdCnt + 1;
list_add_tail(&pRxReorderEntry->List, &ieee->RxReorder_Unused_List);
}
- rtllib_indicate_packets(ieee, RfdArray, RfdCnt);
+ rtllib_indicate_packets(ieee, ieee->RfdArray, RfdCnt);
pTS->RxIndicateSeq = 0xffff;
}
@@ -550,7 +549,6 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee,
{
struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;
struct rx_reorder_entry *pReorderEntry = NULL;
- struct rtllib_rxb *prxbIndicateArray[REORDER_WIN_SIZE];
u8 WinSize = pHTInfo->RxReorderWinSize;
u16 WinEnd = 0;
u8 index = 0;
@@ -617,7 +615,7 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee,
RTLLIB_DEBUG(RTLLIB_DL_REORDER, "Packets indication!! "
"IndicateSeq: %d, NewSeq: %d\n",
pTS->RxIndicateSeq, SeqNum);
- prxbIndicateArray[0] = prxb;
+ ieee->prxbIndicateArray[0] = prxb;
index = 1;
} else {
/* Current packet is going to be inserted into pending list.*/
@@ -693,7 +691,7 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee,
if (SN_EQUAL(pReorderEntry->SeqNum, pTS->RxIndicateSeq))
pTS->RxIndicateSeq = (pTS->RxIndicateSeq + 1) % 4096;
- prxbIndicateArray[index] = pReorderEntry->prxb;
+ ieee->prxbIndicateArray[index] = pReorderEntry->prxb;
RTLLIB_DEBUG(RTLLIB_DL_REORDER, "%s(): Indicate SeqNum"
" %d!\n", __func__, pReorderEntry->SeqNum);
index++;
@@ -720,7 +718,7 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee,
flags);
return;
}
- rtllib_indicate_packets(ieee, prxbIndicateArray, index);
+ rtllib_indicate_packets(ieee, ieee->prxbIndicateArray, index);
bPktInBuf = false;
}