lightnvm: pblk: use vfree to free metadata on error path
authorHans Holmberg <hans.holmberg@cnexlabs.com>
Mon, 11 Feb 2019 12:25:03 +0000 (13:25 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 11 Feb 2019 15:18:07 +0000 (08:18 -0700)
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>
Signed-off-by: Matias Bjørling <mb@lightnvm.io>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/lightnvm/pblk-core.c

index 1ff1653511809d22b8ff18ac3c9a7f644d52470c..1b5ff51faa632fd0d20513272fb70c2baddaf0c6 100644 (file)
@@ -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);
        }