lkml.org 
[lkml]   [2019]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: memory leak in nfs_get_client
On Tue, Jun 11, 2019 at 12:23:12PM -0400, Benjamin Coddington wrote:
> Ugh.. Now that you can cancel the wait, you have to also handle if "new" was
> allocated. I think this needs:
>
> diff --git a/fs/nfs/client.c b/fs/nfs/client.c
> index d7e4f0848e28..4d90f5bf0b0a 100644
> --- a/fs/nfs/client.c
> +++ b/fs/nfs/client.c
> @@ -406,10 +406,10 @@ struct nfs_client *nfs_get_client(const struct
> nfs_client_initdata *cl_init)
> clp = nfs_match_client(cl_init);
> if (clp) {
> spin_unlock(&nn->nfs_client_lock);
> - if (IS_ERR(clp))
> - return clp;
> if (new)
> new->rpc_ops->free_client(new);
> + if (IS_ERR(clp))
> + return clp;
> return nfs_found_client(cl_init, clp);
> }
> if (new) {
>
> I'll patch/test and send it along.
>
> Ben

Hi Ben, what happened to this patch?

- Eric

\
 
 \ /
  Last update: 2019-07-02 08:32    [W:0.154 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site