diff options
author | Hannes Reinecke <hare@suse.de> | 2018-08-07 12:43:42 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-08-07 14:40:27 +0200 |
commit | 8f220c418d070a097f7d292cf6b37f88d67845ad (patch) | |
tree | 54596534a95595541a9be00cc2fc78239ab0c04d /drivers | |
parent | f10fe9d85dc0802b54519c917716e6f0092b4ce7 (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/nvme/host/multipath.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c index c643872f8dac..5a9562881d4e 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -22,7 +22,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)); } /* |