diff options
| author | Keith Busch <keith.busch@intel.com> | 2017-12-14 13:20:32 -0500 |
|---|---|---|
| committer | Christoph Hellwig <hch@lst.de> | 2017-12-15 09:18:07 -0500 |
| commit | 654b4a4acd8b52a4272114b95896e9a10d382cde (patch) | |
| tree | 55df7d1539b6b58815e67c92a55f451b72bb1f87 /drivers | |
| parent | 249159c5f15812140fa216f9997d799ac0023a1f (diff) | |
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')
| -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) | |||
| 2870 | 2870 | ||
| 2871 | blk_queue_logical_block_size(ns->queue, 1 << ns->lba_shift); | 2871 | blk_queue_logical_block_size(ns->queue, 1 << ns->lba_shift); |
| 2872 | nvme_set_queue_limits(ctrl, ns->queue); | 2872 | nvme_set_queue_limits(ctrl, ns->queue); |
| 2873 | nvme_setup_streams_ns(ctrl, ns); | ||
| 2874 | 2873 | ||
| 2875 | id = nvme_identify_ns(ctrl, nsid); | 2874 | id = nvme_identify_ns(ctrl, nsid); |
| 2876 | if (!id) | 2875 | if (!id) |
| @@ -2881,6 +2880,7 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid) | |||
| 2881 | 2880 | ||
| 2882 | if (nvme_init_ns_head(ns, nsid, id, &new)) | 2881 | if (nvme_init_ns_head(ns, nsid, id, &new)) |
| 2883 | goto out_free_id; | 2882 | goto out_free_id; |
| 2883 | nvme_setup_streams_ns(ctrl, ns); | ||
| 2884 | 2884 | ||
| 2885 | #ifdef CONFIG_NVME_MULTIPATH | 2885 | #ifdef CONFIG_NVME_MULTIPATH |
| 2886 | /* | 2886 | /* |
