[dpdk-dev] [dpdk-stable] [PATCH] kni: fix possible memory leak

Thomas Monjalon thomas at monjalon.net
Fri Apr 21 01:23:40 CEST 2017

18/04/2017 16:21, Ferruh Yigit:
> alloc_q and rx_q fifos holds physical address of the mbufs, and not able
> to free those mbufs explicitly.
> But kernel thread reads from rx_q and puts used mbufs into free_q (with
> their virtual addresses.) And kernel thread stopped when application
> close the /dev/kni file on exit. So rx_q has time to be consumed by
> kernel thread but leak is technically possible.
> Another fifo, alloc_q has physical addresses too, but all those coming
> from same mempool provided by application, when application quit, all
> mempool already returned back, so this leak can be ignored.
> Added check and wait logic for rx_q to be sure kernel consumed the fifo,
> an error message printed after some ammount of wait, and an explicit
> mempool free added for alloc_q.
> Fixes: 8451269e6d7b ("kni: remove continuous memory restriction")
> Cc: stable at dpdk.org
> Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>

Applied, thanks

More information about the dev mailing list