Skip to contentSkip to conversation

wireless: marvell: fix leak of memory skb

PATCH New [email protected] 1 participant 1 message Apr 18, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 4/6 wireless: marvell: fix leak of memory skb

From: Yan Lei <[email protected]>

---
 drivers/net/wireless/marvell/mwifiex/pcie.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/wireless/marvell/mwifiex/pcie.c +5 -1
index d5fb29400..38f73a769
@@ -811,6 +811,8 @@ static int mwifiex_init_rxq_ring(struct mwifiex_adapter *adapter)
 		if (mwifiex_map_pci_memory(adapter, skb,
 					   MWIFIEX_RX_DATA_BUF_SIZE,
 					   DMA_FROM_DEVICE))
+			kfree_skb(skb);
+		    kfree(card->rxbd_ring_vbase);
 			return -1;
 
 		buf_pa = MWIFIEX_SKB_DMA_ADDR(skb);
@@ -1642,8 +1644,10 @@ static int mwifiex_pcie_process_recv_data(struct mwifiex_adapter *adapter)
 
 		if (mwifiex_map_pci_memory(adapter, skb_tmp,
 					   MWIFIEX_RX_DATA_BUF_SIZE,
-					   DMA_FROM_DEVICE))
+					   DMA_FROM_DEVICE)) {
+			dev_kfree_skb_any(skb_tmp);
 			return -1;
+		}
 
 		buf_pa = MWIFIEX_SKB_DMA_ADDR(skb_tmp);
 
Signature · 1 line
2.30.0