From: "Matias Bjørling" <mb@lightnvm.io>
To: "Javier González" <jg@lightnvm.io>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
"Javier González" <javier@cnexlabs.com>
Subject: Re: [PATCH] lightnvm: free properly on target creation error
Date: Mon, 30 Jan 2017 11:19:31 +0100 [thread overview]
Message-ID: <2d46b6b6-4339-a51d-a3fb-1de70b48fe82@lightnvm.io> (raw)
In-Reply-To: <1485446259-2396-1-git-send-email-javier@cnexlabs.com>
On 01/26/2017 04:57 PM, Javier González wrote:
> Fix a memory leak when target creation fails. More specifically, free
> the entire device structure given to the target (tgt_dev).
>
> Signed-off-by: Javier González <javier@cnexlabs.com>
> ---
> drivers/lightnvm/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
> index 8baae61..d5bb5e1 100644
> --- a/drivers/lightnvm/core.c
> +++ b/drivers/lightnvm/core.c
> @@ -309,7 +309,7 @@ static int nvm_create_tgt(struct nvm_dev *dev, struct nvm_ioctl_create *create)
> err_queue:
> blk_cleanup_queue(tqueue);
> err_dev:
> - kfree(tgt_dev);
> + nvm_remove_tgt_dev(tgt_dev);
> err_t:
> kfree(t);
> err_reserve:
>
Thanks. Applied.
prev parent reply other threads:[~2017-01-30 10:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-26 15:57 Javier González
2017-01-30 10:19 ` Matias Bjørling [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2d46b6b6-4339-a51d-a3fb-1de70b48fe82@lightnvm.io \
--to=mb@lightnvm.io \
--cc=javier@cnexlabs.com \
--cc=jg@lightnvm.io \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®