summaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/650-0012-rtl8xxxu-Adjust-RX-skb-size-to-include-space-for-phy.patch
blob: 70c27f2329f3c224a87417395e1ec7a4e49533a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From e9f4ede33cf1cd0bc705de6cd9c150fb3677ed74 Mon Sep 17 00:00:00 2001
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Date: Sat, 21 May 2016 13:45:37 -0400
Subject: [PATCH] rtl8xxxu: Adjust RX skb size to include space for phystats

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>
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
@@ -5276,11 +5276,12 @@ static int rtl8xxxu_submit_rx_urb(struct
 
 	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)