aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCathy Luo <cluo@marvell.com>2016-07-21 07:00:24 -0400
committerKalle Valo <kvalo@codeaurora.org>2016-08-18 09:02:08 -0400
commitc81396f3da22aa8f1e8fbf7943616a0839c4d63d (patch)
treeca22e7a196d9eba407905cf239d2461f9fd94c65
parent184ca823481c99dadd7d946e5afd4bb921eab30d (diff)
mwifiex: fix large amsdu packets causing firmware hang
Sometimes host prepares and downloads a large amsdu packet to firmware which leads to a memory corruption in firmware. The reason is __dev_alloc_skb() may allocate larger buffer than required size. This patch solves the problem by checking "adapter->tx_buf_size" instead of relying on skb_tailroom(). Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r--drivers/net/wireless/marvell/mwifiex/11n_aggr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/marvell/mwifiex/11n_aggr.c b/drivers/net/wireless/marvell/mwifiex/11n_aggr.c
index dc49c3de1f25..c47d6366875d 100644
--- a/drivers/net/wireless/marvell/mwifiex/11n_aggr.c
+++ b/drivers/net/wireless/marvell/mwifiex/11n_aggr.c
@@ -205,7 +205,8 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
205 205
206 do { 206 do {
207 /* Check if AMSDU can accommodate this MSDU */ 207 /* Check if AMSDU can accommodate this MSDU */
208 if (skb_tailroom(skb_aggr) < (skb_src->len + LLC_SNAP_LEN)) 208 if ((skb_aggr->len + skb_src->len + LLC_SNAP_LEN) >
209 adapter->tx_buf_size)
209 break; 210 break;
210 211
211 skb_src = skb_dequeue(&pra_list->skb_head); 212 skb_src = skb_dequeue(&pra_list->skb_head);