Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lightnvm: pblk: use vfree to free metadata on error path

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>

authored by

Hans Holmberg and committed by
Jens Axboe
6916cf54 f9324980

+1 -1
+1 -1
drivers/lightnvm/pblk-core.c
··· 141 141 142 142 ret = nvm_get_chunk_meta(dev, ppa, geo->all_chunks, meta); 143 143 if (ret) { 144 - kfree(meta); 144 + vfree(meta); 145 145 return ERR_PTR(-EIO); 146 146 } 147 147