If create_dma_pools() fails then we just returned the error code but weThanks Sudip. The nvm_free frees the registered manager. However, it should not be cleaned up if it failed. As nothing else is allocated after the registration.
missed freeing the device.
Signed-off-by: Sudip Mukherjee <sudip@xxxxxxxxxxxxxxx>
---
drivers/lightnvm/core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index d288996..9dd1623 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -318,6 +318,7 @@ int nvm_register(struct request_queue *q, char *disk_name,
"ppalist");
if (!dev->ppalist_pool) {
pr_err("nvm: could not create ppa pool\n");
+ nvm_free(dev);
return -ENOMEM;
}
}