Re: [PATCH v3 10/18] nvmet-fcloop: allocate/free fcloop_lsreq directly
From: Daniel Wagner
Date: Tue Apr 08 2025 - 07:26:55 EST
On Tue, Mar 18, 2025 at 02:58:35PM +0100, Daniel Wagner wrote:
> On Tue, Mar 18, 2025 at 12:17:11PM +0100, Hannes Reinecke wrote:
> > > + tls_req = kmalloc(sizeof(*tls_req), GFP_KERNEL);
> > > + if (!tls_req)
> > > + return -ENOMEM;
> >
> > This cries out for kmem_cache_alloc() ...
>
> Okay, will switch to this API. FWIW, in the same call path there are
> more kmallocs.
This change send me down yet another rabbit hole because when
deallocatin the cache, it reported a leak caused by a list_add_tail(x,
y) vs list_add_tail(y,x) bug which I missed the last time...