lightnvm: pblk: fix error path in pblk_lines_alloc_metadata
authorRakesh Pandit <rakesh@tuxera.com>
Fri, 13 Oct 2017 12:45:54 +0000 (14:45 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 13 Oct 2017 14:34:57 +0000 (08:34 -0600)
commitc9d84b350f9b253872fc24f4dcfea166c884ee15
tree8bbff36b9847bebdac26eeaf7736838ffc265ea5
parenta96d50fa0c8d3e399c49a0a90ddbbaabf8a46bb3
lightnvm: pblk: fix error path in pblk_lines_alloc_metadata

Use appropriate memory free calls based on allocation type used and
also fix number of times free is called if kmalloc fails.

Signed-off-by: Rakesh Pandit <rakesh@tuxera.com>
Reviewed-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/lightnvm/pblk-init.c