diff options
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-rx.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c index 18a383798e5d..403de96f9747 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c | |||
@@ -759,7 +759,12 @@ static void iwlagn_pass_packet_to_mac80211(struct iwl_priv *priv, | |||
759 | IWL_ERR(priv, "alloc_skb failed\n"); | 759 | IWL_ERR(priv, "alloc_skb failed\n"); |
760 | return; | 760 | return; |
761 | } | 761 | } |
762 | hdrlen = min_t(unsigned int, len, skb_tailroom(skb)); | 762 | /* If frame is small enough to fit in skb->head, pull it completely. |
763 | * If not, only pull ieee80211_hdr so that splice() or TCP coalesce | ||
764 | * are more efficient. | ||
765 | */ | ||
766 | hdrlen = (len <= skb_tailroom(skb)) ? len : sizeof(*hdr); | ||
767 | |||
763 | memcpy(skb_put(skb, hdrlen), hdr, hdrlen); | 768 | memcpy(skb_put(skb, hdrlen), hdr, hdrlen); |
764 | fraglen = len - hdrlen; | 769 | fraglen = len - hdrlen; |
765 | 770 | ||