From: Rakesh Pandit <rakesh@tuxera.com>
To: <linux-nvme@lists.infradead.org>
Cc: linux-kernel@vger.kernel.org,
"Matias Bjørling" <matias@cnexlabs.com>,
"Christoph Hellwig" <hch@lst.de>,
"Javier González" <jg@lightnvm.io>, "Jens Axboe" <axboe@fb.com>
Subject: [PATCH] nvme: lightnvm: fix memory leak
Date: Tue, 9 May 2017 16:55:08 +0300 [thread overview]
Message-ID: <20170509135506.GA22624@dhcp-216.srv.tuxera.com> (raw)
Free up kmalloc allocated memory if failure happens while handling L2P
table transfer in nvme_nvm_get_l2p_tbl.
Fixes: 8e79b5cb ("lightnvm: move block provisioning to targets")
Signed-off-by: Rakesh Pandit <rakesh@tuxera.com>
---
drivers/nvme/host/lightnvm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c
index 206bfdb..f5df78e 100644
--- a/drivers/nvme/host/lightnvm.c
+++ b/drivers/nvme/host/lightnvm.c
@@ -367,7 +367,8 @@ static int nvme_nvm_get_l2p_tbl(struct nvm_dev *nvmdev, u64 slba, u32 nlb,
if (unlikely(elba > nvmdev->total_secs)) {
pr_err("nvm: L2P data from device is out of bounds!\n");
- return -EINVAL;
+ ret = -EINVAL;
+ goto out;
}
/* Transform physical address to target address space */
--
2.5.5
next reply other threads:[~2017-05-09 13:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-09 13:55 Rakesh Pandit [this message]
2017-05-09 13:59 ` Javier González
2017-05-09 14:49 ` Jens Axboe
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=20170509135506.GA22624@dhcp-216.srv.tuxera.com \
--to=rakesh@tuxera.com \
--cc=axboe@fb.com \
--cc=hch@lst.de \
--cc=jg@lightnvm.io \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=matias@cnexlabs.com \
/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®