Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme: fixup crash on failed discovery
@ 2018-08-07 10:43 Hannes Reinecke
  2018-08-07 11:46 ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Hannes Reinecke @ 2018-08-07 10:43 UTC (permalink / 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-08-07 12:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-07 10:43 [PATCH] nvme: fixup crash on failed discovery Hannes Reinecke
2018-08-07 11:46 ` Christoph Hellwig
2018-08-07 12:01   ` Hannes Reinecke
2018-08-07 12:47     ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox