* [PATCH] lightnvm: pblk: use vfree to free metadata on error path
@ 2019-01-22 10:17 hans
2019-01-22 19:48 ` Matias Bjørling
0 siblings, 1 reply; 2+ messages in thread
From: hans @ 2019-01-22 10:17 UTC (permalink / raw)
To: Matias Bjorling; +Cc: javier, linux-block, linux-kernel, Hans Holmberg
From: Hans Holmberg <hans.holmberg@cnexlabs.com>
As chunk metadata is allocated using vmalloc, we need to free it
using vfree.
Fixes: 090ee26fd512 ("lightnvm: use internal allocation for chunk log page")
Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com>
---
drivers/lightnvm/pblk-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c
index 1ff165351180..1b5ff51faa63 100644
--- a/drivers/lightnvm/pblk-core.c
+++ b/drivers/lightnvm/pblk-core.c
@@ -141,7 +141,7 @@ struct nvm_chk_meta *pblk_get_chunk_meta(struct pblk *pblk)
ret = nvm_get_chunk_meta(dev, ppa, geo->all_chunks, meta);
if (ret) {
- kfree(meta);
+ vfree(meta);
return ERR_PTR(-EIO);
}
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] lightnvm: pblk: use vfree to free metadata on error path
2019-01-22 10:17 [PATCH] lightnvm: pblk: use vfree to free metadata on error path hans
@ 2019-01-22 19:48 ` Matias Bjørling
0 siblings, 0 replies; 2+ messages in thread
From: Matias Bjørling @ 2019-01-22 19:48 UTC (permalink / raw)
To: hans; +Cc: javier, linux-block, linux-kernel, Hans Holmberg
On 1/22/19 11:17 AM, hans@owltronix.com wrote:
> From: Hans Holmberg <hans.holmberg@cnexlabs.com>
>
> As chunk metadata is allocated using vmalloc, we need to free it
> using vfree.
>
> Fixes: 090ee26fd512 ("lightnvm: use internal allocation for chunk log page")
> Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com>
> ---
> drivers/lightnvm/pblk-core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c
> index 1ff165351180..1b5ff51faa63 100644
> --- a/drivers/lightnvm/pblk-core.c
> +++ b/drivers/lightnvm/pblk-core.c
> @@ -141,7 +141,7 @@ struct nvm_chk_meta *pblk_get_chunk_meta(struct pblk *pblk)
>
> ret = nvm_get_chunk_meta(dev, ppa, geo->all_chunks, meta);
> if (ret) {
> - kfree(meta);
> + vfree(meta);
> return ERR_PTR(-EIO);
> }
>
>
Thanks Hans. Applied for 5.1.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-01-22 19:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-22 10:17 [PATCH] lightnvm: pblk: use vfree to free metadata on error path hans
2019-01-22 19:48 ` Matias Bjørling
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).