[PATCH] net/nfp: fix memory leak for receive function

Ferruh Yigit ferruh.yigit at amd.com
Wed Oct 5 17:41:48 CEST 2022


On 9/22/2022 2:09 PM, Niklas Söderlund wrote:
> From: Long Wu <long.wu at corigine.com>
> 
> nfp_net_recv_pkts() should not return a value that less than 0 and the
> inappropriate return value in receive loop also causes the memory leak.
> Modify code to avoid return a value less than 0. Furthermore, When
> nfp_net_recv_pkts() break out from the receive loop because of packet
> problems, a rte_mbuf will not be freed and it will cause memory leak.
> Free the rte_mbuf before break out.
> 
> Fixes: b812daadad0d ("nfp: add Rx and Tx")
> Cc: louis.peens at corigine.com
> Cc: stable at dpdk.org
> 
> Signed-off-by: Long Wu <long.wu at corigine.com>
> Reviewed-by: Chaoyong He <chaoyong.he at corigine.com>
> Reviewed-by: Niklas Söderlund <niklas.soderlund at corigine.com>
> Signed-off-by: Niklas Söderlund <niklas.soderlund at corigine.com>

Applied to dpdk-next-net/main, thanks.



More information about the stable mailing list