Skip to content

Commit c81396f

Browse files
Cathy LuoKalle Valo
authored andcommitted
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 <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
1 parent 184ca82 commit c81396f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/wireless/marvell/mwifiex/11n_aggr.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
205205

206206
do {
207207
/* 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)
209210
break;
210211

211212
skb_src = skb_dequeue(&pra_list->skb_head);

0 commit comments

Comments
 (0)