Skip to content

Commit 285fa6b

Browse files
LorenzoBianconikuba-moo
authored andcommitted
net: airoha: Fix memory leak in airoha_qdma_rx_process()
If an error occurs on the subsequents buffers belonging to the non-linear part of the skb (e.g. due to an error in the payload length reported by the NIC or if we consumed all the available fragments for the skb), the page_pool fragment will not be linked to the skb so it will not return to the pool in the airoha_qdma_rx_process() error path. Fix the memory leak partially reverting commit 'd6d2b0e1538d ("net: airoha: Fix page recycling in airoha_qdma_rx_process()")' and always running page_pool_put_full_page routine in the airoha_qdma_rx_process() error path. Fixes: d6d2b0e ("net: airoha: Fix page recycling in airoha_qdma_rx_process()") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20260402-airoha_qdma_rx_process-mem-leak-fix-v1-1-b5706f402d3c@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent b120e44 commit 285fa6b

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/net/ethernet/airoha/airoha_eth.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,9 +697,8 @@ static int airoha_qdma_rx_process(struct airoha_queue *q, int budget)
697697
if (q->skb) {
698698
dev_kfree_skb(q->skb);
699699
q->skb = NULL;
700-
} else {
701-
page_pool_put_full_page(q->page_pool, page, true);
702700
}
701+
page_pool_put_full_page(q->page_pool, page, true);
703702
}
704703
airoha_qdma_fill_rx_queue(q);
705704

0 commit comments

Comments
 (0)