Skip to content

Commit

Permalink
ath9k: Fix bug in validating received data length for edma
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vasanthakumar Thiagarajan authored and John W. Linville committed Jun 2, 2010
1 parent 5c6dd92 commit b7b1b51
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/wireless/ath/ath9k/recv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

/*
Expand Down

0 comments on commit b7b1b51

Please sign in to comment.