[PATCH] nvme: fix memory leak freeing command effects

Keith Busch kbusch at kernel.org
Tue Nov 17 10:26:36 EST 2020


On Mon, Nov 16, 2020 at 11:23:30PM +0000, Chaitanya Kulkarni wrote:
> On 11/13/20 10:45, Keith Busch wrote:
> > xa_destroy() frees only internal data. The caller is responsible for
> > freeing the exteranl objects referenced by an xarray.
> >
> > Fixes: 1cf7a12e09aa4 ("nvme: use an xarray to lookup the Commands Supported and Effects log")
> > Signed-off-by: Keith Busch <kbusch at kernel.org>
> > ---
> 
> Thanks for fixing this up, it'd nice to have a common helper
> which also erases the itmes from XArray so we don't have to
> repeat the code to erase item indivisually.

That would be okay if there are multiple users that have a simple
kfree() on their elements when tearing down their xarray, but I'm not
finding others so far.



More information about the Linux-nvme mailing list