diff options
author | Keith Busch <keith.busch@intel.com> | 2017-12-14 11:20:32 -0700 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2017-12-15 15:18:07 +0100 |
commit | 654b4a4acd8b52a4272114b95896e9a10d382cde (patch) | |
tree | 55df7d1539b6b58815e67c92a55f451b72bb1f87 /drivers/nvme | |
parent | 249159c5f15812140fa216f9997d799ac0023a1f (diff) | |
download | linux-stable-654b4a4acd8b52a4272114b95896e9a10d382cde.tar.gz linux-stable-654b4a4acd8b52a4272114b95896e9a10d382cde.tar.bz2 linux-stable-654b4a4acd8b52a4272114b95896e9a10d382cde.zip |
nvme: setup streams after initializing namespace head
Fixes a NULL pointer dereference.
Reported-by: Arnav Dawn <a.dawn@samsung.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/host/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index eab812dd2429..1e46e60b8f10 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -2870,7 +2870,6 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid) blk_queue_logical_block_size(ns->queue, 1 << ns->lba_shift); nvme_set_queue_limits(ctrl, ns->queue); - nvme_setup_streams_ns(ctrl, ns); id = nvme_identify_ns(ctrl, nsid); if (!id) @@ -2881,6 +2880,7 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid) if (nvme_init_ns_head(ns, nsid, id, &new)) goto out_free_id; + nvme_setup_streams_ns(ctrl, ns); #ifdef CONFIG_NVME_MULTIPATH /* |