From: Vasanthakumar Thiagarajan Date: Thu, 20 May 2010 21:34:48 +0000 (-0700) Subject: ath9k: Fix bug in validating received data length for edma X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b7b1b512287d6917d4976a4ee0e7d72c4edf52eb;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git 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 Signed-off-by: John W. Linville --- 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, { struct ath_hw *ah = common->ah; __le16 fc; + u8 rx_status_len = ah->caps.rx_status_len; fc = hdr->frame_control; @@ -840,7 +841,7 @@ static bool ath9k_rx_accept(struct ath_common *common, * we can take a hint that hardware corrupted it, so ignore * those frames. */ - if (rx_stats->rs_datalen > common->rx_bufsize) + if (rx_stats->rs_datalen > (common->rx_bufsize - rx_status_len)) return false; /*