From patchwork Wed Dec 2 12:16:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matias_Bj=C3=B8rling?= X-Patchwork-Id: 7745491 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 25775BEEE1 for ; Wed, 2 Dec 2015 12:16:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4EED320631 for ; Wed, 2 Dec 2015 12:16:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0533C205B7 for ; Wed, 2 Dec 2015 12:16:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754426AbbLBMQv (ORCPT ); Wed, 2 Dec 2015 07:16:51 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:37770 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753244AbbLBMQv (ORCPT ); Wed, 2 Dec 2015 07:16:51 -0500 Received: by wmww144 with SMTP id w144so54233754wmw.0 for ; Wed, 02 Dec 2015 04:16:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bjorling.me; s=google; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=kPp21spihPh82j1lOBs6ibtNuZY5hsRn0uXxboGONak=; b=FpeyD2EPhs679JJSdx1x1obbJJMD80GibfnUKu2JTamTa0wkBswZ74GiDDMjVVD8Ee KymCKJu5avQUb7Pe7rqIlbaawABqPXRg+7U9vy2Zo2pfhi+8ZwTSg49YEIltwgT3CiPu vN2KrjxMIa5NlmKpk8s5HoaLJOJO9aHBEmTSQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-type:content-transfer-encoding; bh=kPp21spihPh82j1lOBs6ibtNuZY5hsRn0uXxboGONak=; b=BltgAIxZk3uLGy5kKYgO3Wkpwk+2Gqsa94ZbzY/dFnA4hAvgRXKKwY3zmwdbt+GEBl EP30UTxxGzsAau0txVEgAtQrS81O8zqVBguTIA5w/Kduqj9YeW5ibKOvdabIFS+lk9Iw GQYL7L5BzmKhXleHRngj/q54TWkSBN41bXFDHBsxmfFdJcVjLuILsGufva77kvw7EGFB 33bMcH3d2a56CjEQNdDb4lMoeLDZQBRG/wgNmMPPyY/Y0dArAELZNIWMrEVqTMxwzGma Mc9w/Ew0CbUV8TJ8nCYghoKLm6bGFQquApOJgdPcoWkJuUj6FVJISyqn0EOo/nbUeOKu 6JkA== X-Gm-Message-State: ALoCoQkYLZXWC1v2PU2TDQX5543s7z+neSEBjg91kuqNZPYvtl1vdX3gH0ZmrGWTNNq1CP5Z8pTj X-Received: by 10.28.15.194 with SMTP id 185mr5648420wmp.9.1449058609821; Wed, 02 Dec 2015 04:16:49 -0800 (PST) Received: from localhost.localdomain (6164198-cl69.boa.fiberby.dk. [193.106.164.198]) by smtp.gmail.com with ESMTPSA id q9sm2556213wjo.9.2015.12.02.04.16.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Dec 2015 04:16:49 -0800 (PST) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH RFC 1/3] lightnvm: check mm before use Date: Wed, 2 Dec 2015 13:16:21 +0100 Message-Id: <1449058583-27940-1-git-send-email-m@bjorling.me> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The core can initialize I/Os before a media manager is registered with the lightnvm subsystem. Make sure that we don't call the media manager prematurely. Signed-off-by: Matias Bjørling --- drivers/nvme/host/lightnvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c index 06c3364..762c9a7 100644 --- a/drivers/nvme/host/lightnvm.c +++ b/drivers/nvme/host/lightnvm.c @@ -455,7 +455,7 @@ static void nvme_nvm_end_io(struct request *rq, int error) struct nvm_rq *rqd = rq->end_io_data; struct nvm_dev *dev = rqd->dev; - if (dev->mt->end_io(rqd, error)) + if (dev->mt && dev->mt->end_io(rqd, error)) pr_err("nvme: err status: %x result: %lx\n", rq->errors, (unsigned long)rq->special);