]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
ath9k_htc: Fix RX length check
authorSujith Manoharan <Sujith.Manoharan@atheros.com>
Wed, 13 Apr 2011 05:54:19 +0000 (11:24 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 13 Apr 2011 19:22:44 +0000 (15:22 -0400)
The length of the received SKB could be equal to
HTC_RX_FRAME_HEADER_SIZE in case of packets with phy/crc errors,
in which case they are dropped without being processed.
Fix this check so that the error counters are updated correctly.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c

index a62495d1330a7cbe708363f8d074527382ad728f..7cd3e4e66aa60880b53043ddc3f38ceeaa18f8f9 100644 (file)
@@ -525,8 +525,9 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv,
        int last_rssi = ATH_RSSI_DUMMY_MARKER;
        __le16 fc;
 
-       if (skb->len <= HTC_RX_FRAME_HEADER_SIZE) {
-               ath_err(common, "Corrupted RX frame, dropping\n");
+       if (skb->len < HTC_RX_FRAME_HEADER_SIZE) {
+               ath_err(common, "Corrupted RX frame, dropping (len: %d)\n",
+                       skb->len);
                goto rx_next;
        }