Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754541AbbKXKhP (ORCPT ); Tue, 24 Nov 2015 05:37:15 -0500 Received: from mail-pa0-f48.google.com ([209.85.220.48]:33053 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754279AbbKXKfO (ORCPT ); Tue, 24 Nov 2015 05:35:14 -0500 From: Sudip Mukherjee To: Matias Bjorling Cc: linux-kernel@vger.kernel.org, Sudip Mukherjee Subject: [PATCH v2 4/5] lightnvm: release dev if dma pools fails Date: Tue, 24 Nov 2015 16:04:59 +0530 Message-Id: <1448361300-26718-4-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1448361300-26718-1-git-send-email-sudipm.mukherjee@gmail.com> References: <1448361300-26718-1-git-send-email-sudipm.mukherjee@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 857 Lines: 28 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; } } -- 1.9.1 -- 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/