Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754495AbbKXKgO (ORCPT ); Tue, 24 Nov 2015 05:36:14 -0500 Received: from mail-pa0-f51.google.com ([209.85.220.51]:34174 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753571AbbKXKfQ (ORCPT ); Tue, 24 Nov 2015 05:35:16 -0500 From: Sudip Mukherjee To: Matias Bjorling Cc: linux-kernel@vger.kernel.org, Sudip Mukherjee Subject: [PATCH v2 5/5] lightnvm: return error if manager not found Date: Tue, 24 Nov 2015 16:05:00 +0530 Message-Id: <1448361300-26718-5-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: 1039 Lines: 34 We were returning a success value even if a manager was not found. Signed-off-by: Sudip Mukherjee --- Not sure if it was intentionally done like that way. This patch is placed at the end so it will be easy to drop if i am wrong. Did this change seeing similar code in nvm_create_target(). drivers/lightnvm/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index 9dd1623..c34d0cd 100644 --- a/drivers/lightnvm/core.c +++ b/drivers/lightnvm/core.c @@ -264,7 +264,8 @@ static int nvm_init(struct nvm_dev *dev) if (!ret) { pr_info("nvm: no compatible manager found.\n"); - return 0; + ret = -ENODEV; + goto err; } pr_info("nvm: registered %s [%u/%u/%u/%u/%u/%u]\n", -- 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/