aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-04-17 16:37:31 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-18 19:58:16 -0400
commitf7738eda211091d8caf612b2bc1bac2fb52e48c6 (patch)
tree74f8000ebd2a6e5df99c36db185a6003313d3a51
parented2cb4f3b5ed96e4d10e054f981bbe58d0e3508e (diff)
Staging: rtl8192u: fix some memory corruption
When we received a command we incremented a stat counter depending on the type of message. The problem is there were 8 types of commands but there were only 4 counters allocated so it corrupted memory past the end of the rxcmdpkt[] array. The fix is just to remove the counters because they aren't used. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> ACKed-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/rtl8192u/r8192U.h1
-rw-r--r--drivers/staging/rtl8192u/r819xU_cmdpkt.c4
2 files changed, 0 insertions, 5 deletions
diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h
index 9b81f26d40fe..43d459d81885 100644
--- a/drivers/staging/rtl8192u/r8192U.h
+++ b/drivers/staging/rtl8192u/r8192U.h
@@ -610,7 +610,6 @@ typedef struct Stats
610// unsigned long rxnopointer; 610// unsigned long rxnopointer;
611 unsigned long rxok; 611 unsigned long rxok;
612 unsigned long rxframgment; 612 unsigned long rxframgment;
613 unsigned long rxcmdpkt[4]; //08/05/08 amy rx cmd element txfeedback/bcn report/cfg set/query
614 unsigned long rxurberr; 613 unsigned long rxurberr;
615 unsigned long rxstaterr; 614 unsigned long rxstaterr;
616 unsigned long received_rate_histogram[4][32]; //0: Total, 1:OK, 2:CRC, 3:ICV, 2007 07 03 cosa 615 unsigned long received_rate_histogram[4][32]; //0: Total, 1:OK, 2:CRC, 3:ICV, 2007 07 03 cosa
diff --git a/drivers/staging/rtl8192u/r819xU_cmdpkt.c b/drivers/staging/rtl8192u/r819xU_cmdpkt.c
index 0cb28c776c49..9348f429d590 100644
--- a/drivers/staging/rtl8192u/r819xU_cmdpkt.c
+++ b/drivers/staging/rtl8192u/r819xU_cmdpkt.c
@@ -697,7 +697,6 @@ cmpk_message_handle_rx(
697 struct ieee80211_rx_stats *pstats) 697 struct ieee80211_rx_stats *pstats)
698{ 698{
699// u32 debug_level = DBG_LOUD; 699// u32 debug_level = DBG_LOUD;
700 struct r8192_priv *priv = ieee80211_priv(dev);
701 int total_length; 700 int total_length;
702 u8 cmd_length, exe_cnt = 0; 701 u8 cmd_length, exe_cnt = 0;
703 u8 element_id; 702 u8 element_id;
@@ -779,9 +778,6 @@ cmpk_message_handle_rx(
779 // 2007/01/22 MH Add to display tx statistic. 778 // 2007/01/22 MH Add to display tx statistic.
780 //cmpk_DisplayTxStatistic(pAdapter); 779 //cmpk_DisplayTxStatistic(pAdapter);
781 780
782 /* 2007/03/09 MH Collect sidderent cmd element pkt num. */
783 priv->stats.rxcmdpkt[element_id]++;
784
785 total_length -= cmd_length; 781 total_length -= cmd_length;
786 pcmd_buff += cmd_length; 782 pcmd_buff += cmd_length;
787 } /* while (total_length > 0) */ 783 } /* while (total_length > 0) */