lkml.org 
[lkml]   [2015]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 3/5] lightnvm: create dma pool first
On 11/24/2015 11:34 AM, Sudip Mukherjee wrote:
> If create_dma_pool() fails then we are returning the error code but we
> have already added the device to the list. Lets add the device to the
> list only if everything is successfully initialized.
>
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
> drivers/lightnvm/core.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
> index 2ab561f..d288996 100644
> --- a/drivers/lightnvm/core.c
> +++ b/drivers/lightnvm/core.c
> @@ -313,10 +313,6 @@ int nvm_register(struct request_queue *q, char *disk_name,
> if (ret)
> goto err_init;
>
> - down_write(&nvm_lock);
> - list_add(&dev->devices, &nvm_devices);
> - up_write(&nvm_lock);
> -
> if (dev->ops->max_phys_sect > 1) {
> dev->ppalist_pool = dev->ops->create_dma_pool(dev->q,
> "ppalist");
> @@ -326,6 +322,10 @@ int nvm_register(struct request_queue *q, char *disk_name,
> }
> }
>
> + down_write(&nvm_lock);
> + list_add(&dev->devices, &nvm_devices);
> + up_write(&nvm_lock);
> +
> return 0;
> err_init:
> kfree(dev);
>

Thanks. This have already been fixed.


\
 
 \ /
  Last update: 2015-11-24 12:21    [W:0.059 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site