Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: hare@suse.de (Hannes Reinecke)
Subject: [PATCH] nvme: fixup crash on failed discovery
Date: Tue,  7 Aug 2018 12:43:42 +0200	[thread overview]
Message-ID: <20180807104342.44367-1-hare@suse.de> (raw)

When the initial discovery fails the subsystem hasn't been setup,
and we'll encounter a kernel oops during shutdown.

Signed-off-by: Hannes Reinecke <hare at suse.com>
---
 drivers/nvme/host/multipath.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index 420efcda33d9..c1f41aa879c1 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -24,7 +24,7 @@ MODULE_PARM_DESC(multipath,
 
 inline bool nvme_ctrl_use_ana(struct nvme_ctrl *ctrl)
 {
-	return multipath && (ctrl->subsys->cmic & (1 << 3));
+	return multipath && ctrl->subsys && (ctrl->subsys->cmic & (1 << 3));
 }
 
 /*
-- 
2.12.3

             reply	other threads:[~2018-08-07 10:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-07 10:43 Hannes Reinecke [this message]
2018-08-07 11:46 ` [PATCH] nvme: fixup crash on failed discovery Christoph Hellwig
2018-08-07 12:01   ` Hannes Reinecke
2018-08-07 12:47     ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180807104342.44367-1-hare@suse.de \
    --to=hare@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox