Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754464AbbKXLGd (ORCPT ); Tue, 24 Nov 2015 06:06:33 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:33541 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753009AbbKXLGb (ORCPT ); Tue, 24 Nov 2015 06:06:31 -0500 Message-ID: <565444B5.9010509@lightnvm.io> Date: Tue, 24 Nov 2015 12:06:29 +0100 From: =?windows-1252?Q?Matias_Bj=F8rling?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Sudip Mukherjee CC: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org Subject: Re: [PATCH v2 4/5] lightnvm: release dev if dma pools fails References: <1448361300-26718-1-git-send-email-sudipm.mukherjee@gmail.com> <1448361300-26718-4-git-send-email-sudipm.mukherjee@gmail.com> In-Reply-To: <1448361300-26718-4-git-send-email-sudipm.mukherjee@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1104 Lines: 30 On 11/24/2015 11:34 AM, Sudip Mukherjee wrote: > If create_dma_pools() fails then we just returned the error code but we > missed freeing the device. > > Signed-off-by: Sudip Mukherjee > --- > 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; > } > } > Thanks 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/