rtl8xxxu: Adjust RX skb size to include space for phystats
authorJes Sorensen <Jes.Sorensen@redhat.com>
Mon, 27 Jun 2016 16:32:05 +0000 (12:32 -0400)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 8 Jul 2016 13:41:56 +0000 (16:41 +0300)
The old allocation didn't leave space for phystats in the buffer,
allowing the packet to be rejected if a frame size of size
IEEE80211_MAX_FRAME_LEN was received.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c

index 75149e49f333721c08cc21b0a71d5269a4b544c4..898601accabbf3b007f23e134db5c647838deeab 100644 (file)
@@ -5276,11 +5276,12 @@ static int rtl8xxxu_submit_rx_urb(struct rtl8xxxu_priv *priv,
 
        rx_desc_sz = fops->rx_desc_size;
 
-       if (priv->rx_buf_aggregation && fops->rx_agg_buf_size)
+       if (priv->rx_buf_aggregation && fops->rx_agg_buf_size) {
                skb_size = fops->rx_agg_buf_size;
-       else
+               skb_size += (rx_desc_sz + sizeof(struct rtl8723au_phy_stats));
+       } else {
                skb_size = IEEE80211_MAX_FRAME_LEN;
-       skb_size += rx_desc_sz;
+       }
 
        skb = __netdev_alloc_skb(NULL, skb_size, GFP_KERNEL);
        if (!skb)