Re: [PATCH] nfsd: fix memory leak in nfsd_create_serv error paths
From: Chuck Lever
Date: Mon Nov 17 2025 - 11:24:47 EST
From: Chuck Lever <chuck.lever@xxxxxxxxxx>
On Mon, 17 Nov 2025 17:41:21 +0530, Shardul Bankar wrote:
> When nfsd_create_serv() calls percpu_ref_init() to initialize
> nn->nfsd_net_ref, it allocates both a percpu reference counter
> and a percpu_ref_data structure (64 bytes). However, if the
> function fails later due to svc_create_pooled() returning NULL
> or svc_bind() returning an error, these allocations are not
> cleaned up, resulting in a memory leak.
>
> [...]
Applied to nfsd-testing, thanks!
[1/1] nfsd: fix memory leak in nfsd_create_serv error paths
commit: d0ce35d0a4fe945e72b57be84d6e4e59c28e87d3
--
Chuck Lever