Commit 1398d458 authored by Alban Browaeys's avatar Alban Browaeys Committed by John W. Linville

rt2x00 : trim the skb after having the l2pad removed.

Otherwise we end up truncating the skb before removing the l2pad
thus we might have the truncated part become garbage while getting
it back in remove_l2pad.
For the same issue: remove the skb_trim from the rt2800 fill_rxdone
(it is done after l2pad removal in rt2x00lib_rxdone).
Signed-off-by: default avatarAlban Browaeys <prahal@yahoo.com>
Acked-by: default avatarGertjan van Wingerde <gwingerde@gmail.com>
Acked-by: default avatarIvo van Doorn <ivdoorn@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent e81e0aef
...@@ -927,7 +927,6 @@ static void rt2800pci_fill_rxdone(struct queue_entry *entry, ...@@ -927,7 +927,6 @@ static void rt2800pci_fill_rxdone(struct queue_entry *entry,
* Remove TXWI descriptor from start of buffer. * Remove TXWI descriptor from start of buffer.
*/ */
skb_pull(entry->skb, RXWI_DESC_SIZE); skb_pull(entry->skb, RXWI_DESC_SIZE);
skb_trim(entry->skb, rxdesc->size);
} }
/* /*
......
...@@ -663,7 +663,6 @@ static void rt2800usb_fill_rxdone(struct queue_entry *entry, ...@@ -663,7 +663,6 @@ static void rt2800usb_fill_rxdone(struct queue_entry *entry,
* Remove RXWI descriptor from start of buffer. * Remove RXWI descriptor from start of buffer.
*/ */
skb_pull(entry->skb, skbdesc->desc_len); skb_pull(entry->skb, skbdesc->desc_len);
skb_trim(entry->skb, rxdesc->size);
} }
/* /*
......
...@@ -385,9 +385,6 @@ void rt2x00lib_rxdone(struct rt2x00_dev *rt2x00dev, ...@@ -385,9 +385,6 @@ void rt2x00lib_rxdone(struct rt2x00_dev *rt2x00dev,
memset(&rxdesc, 0, sizeof(rxdesc)); memset(&rxdesc, 0, sizeof(rxdesc));
rt2x00dev->ops->lib->fill_rxdone(entry, &rxdesc); rt2x00dev->ops->lib->fill_rxdone(entry, &rxdesc);
/* Trim buffer to correct size */
skb_trim(entry->skb, rxdesc.size);
/* /*
* The data behind the ieee80211 header must be * The data behind the ieee80211 header must be
* aligned on a 4 byte boundary. * aligned on a 4 byte boundary.
...@@ -409,6 +406,9 @@ void rt2x00lib_rxdone(struct rt2x00_dev *rt2x00dev, ...@@ -409,6 +406,9 @@ void rt2x00lib_rxdone(struct rt2x00_dev *rt2x00dev,
else else
rt2x00queue_align_payload(entry->skb, header_length); rt2x00queue_align_payload(entry->skb, header_length);
/* Trim buffer to correct size */
skb_trim(entry->skb, rxdesc.size);
/* /*
* Check if the frame was received using HT. In that case, * Check if the frame was received using HT. In that case,
* the rate is the MCS index and should be passed to mac80211 * the rate is the MCS index and should be passed to mac80211
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment