aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vasanth@atheros.com>2010-05-20 17:34:48 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-06-02 16:13:32 -0400
commitb7b1b512287d6917d4976a4ee0e7d72c4edf52eb (patch)
tree2e098ddf22ccd61cb09159aec3b9a236ebcc1f8a
parent5c6dd921776946d12cbbae8ab92c5d6773b25810 (diff)
ath9k: Fix bug in validating received data length for edma
The rx status length should also be taken into account while validating the length of a received frame. Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 978b4d91f931..1618f8fe195d 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -830,6 +830,7 @@ static bool ath9k_rx_accept(struct ath_common *common,
830{ 830{
831 struct ath_hw *ah = common->ah; 831 struct ath_hw *ah = common->ah;
832 __le16 fc; 832 __le16 fc;
833 u8 rx_status_len = ah->caps.rx_status_len;
833 834
834 fc = hdr->frame_control; 835 fc = hdr->frame_control;
835 836
@@ -840,7 +841,7 @@ static bool ath9k_rx_accept(struct ath_common *common,
840 * we can take a hint that hardware corrupted it, so ignore 841 * we can take a hint that hardware corrupted it, so ignore
841 * those frames. 842 * those frames.
842 */ 843 */
843 if (rx_stats->rs_datalen > common->rx_bufsize) 844 if (rx_stats->rs_datalen > (common->rx_bufsize - rx_status_len))
844 return false; 845 return false;
845 846
846 /* 847 /*