[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.21.1803301958530.9681@casper.infradead.org>
Date: Fri, 30 Mar 2018 19:58:58 +0100 (BST)
From: James Simmons <jsimmons@...radead.org>
To: NeilBrown <neilb@...e.com>
cc: Oleg Drokin <oleg.drokin@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Andreas Dilger <andreas.dilger@...el.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Lustre Development List <lustre-devel@...ts.lustre.org>
Subject: Re: [PATCH 07/17] staging: lustre: ldlm: free resource when
ldlm_lock_create() fails.
> ldlm_lock_create() gets a resource, but don't put it on
> all failure paths. It should.
Reviewed-by: James Simmons <jsimmons@...radead.org>
> Signed-off-by: NeilBrown <neilb@...e.com>
> ---
> drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
> index b8fd778d9832..614caa4a9b0e 100644
> --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
> +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
> @@ -1551,8 +1551,10 @@ struct ldlm_lock *ldlm_lock_create(struct ldlm_namespace *ns,
> return ERR_CAST(res);
>
> lock = ldlm_lock_new(res);
> - if (!lock)
> + if (!lock) {
> + ldlm_resource_putref(res);
> return ERR_PTR(-ENOMEM);
> + }
>
> lock->l_req_mode = mode;
> lock->l_ast_data = data;
> @@ -1595,6 +1597,8 @@ struct ldlm_lock *ldlm_lock_create(struct ldlm_namespace *ns,
> return ERR_PTR(rc);
> }
>
> +
> +
> /**
> * Enqueue (request) a lock.
> * On the client this is called from ldlm_cli_enqueue_fini
>
>
>
Powered by blists - more mailing lists