Re: [PATCH v2 1/1] xdp: avoid calling kfree twice

2020-12-09 Thread Zhu Yanjun
On Wed, Dec 9, 2020 at 6:44 PM Toke Høiland-Jørgensen wrote: > > Zhu Yanjun writes: > > > On Wed, Dec 9, 2020 at 1:12 AM Daniel Borkmann wrote: > >> > >> On 12/9/20 6:03 AM, Zhu Yanjun wrote: > >> > In the function xdp_umem_pin_pages, if npgs != umem->npgs and > >> > npgs >= 0, the function xdp_

Re: [PATCH v2 1/1] xdp: avoid calling kfree twice

2020-12-09 Thread Toke Høiland-Jørgensen
Zhu Yanjun writes: > On Wed, Dec 9, 2020 at 1:12 AM Daniel Borkmann wrote: >> >> On 12/9/20 6:03 AM, Zhu Yanjun wrote: >> > In the function xdp_umem_pin_pages, if npgs != umem->npgs and >> > npgs >= 0, the function xdp_umem_unpin_pages is called. In this >> > function, kfree is called to handle

Re: [PATCH v2 1/1] xdp: avoid calling kfree twice

2020-12-08 Thread Zhu Yanjun
On Wed, Dec 9, 2020 at 1:12 AM Daniel Borkmann wrote: > > On 12/9/20 6:03 AM, Zhu Yanjun wrote: > > In the function xdp_umem_pin_pages, if npgs != umem->npgs and > > npgs >= 0, the function xdp_umem_unpin_pages is called. In this > > function, kfree is called to handle umem->pgs, and then in the >

Re: [PATCH v2 1/1] xdp: avoid calling kfree twice

2020-12-08 Thread Daniel Borkmann
On 12/9/20 6:03 AM, Zhu Yanjun wrote: In the function xdp_umem_pin_pages, if npgs != umem->npgs and npgs >= 0, the function xdp_umem_unpin_pages is called. In this function, kfree is called to handle umem->pgs, and then in the function xdp_umem_pin_pages, kfree is called again to handle umem->pgs

[PATCH v2 1/1] xdp: avoid calling kfree twice

2020-12-07 Thread Zhu Yanjun
In the function xdp_umem_pin_pages, if npgs != umem->npgs and npgs >= 0, the function xdp_umem_unpin_pages is called. In this function, kfree is called to handle umem->pgs, and then in the function xdp_umem_pin_pages, kfree is called again to handle umem->pgs. Eventually, umem->pgs is freed twice.