nvme: fixup crash on failed discovery

When the initial discovery fails the subsystem hasn't been setup yet
in nvme_mpath_stop, and we can't dereference ctrl->subsys.

Fixes: 0d0b660f ("nvme: add ANA support")
Signed-off-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
Hannes Reinecke 2018-08-07 12:43:42 +02:00 committed by Christoph Hellwig
parent f10fe9d85d
commit 8f220c418d
1 changed files with 1 additions and 1 deletions

View File

@ -22,7 +22,7 @@ MODULE_PARM_DESC(multipath,
inline bool nvme_ctrl_use_ana(struct nvme_ctrl *ctrl) 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));
} }
/* /*