Skip to contentSkip to conversation

nvme: Setup streams after initializing namespace head

PATCH New Keith Busch 3 participants 3 messages Dec 14, 2017 – Dec 15, 2017 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme: Setup streams after initializing namespace head

Fixes a NULL pointer dereference.

Reported-by Arnav Dawn <a.dawn at samsung.com>
Signed-off-by Keith Busch <keith.busch at intel.com>
---
 drivers/nvme/host/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/core.c +1 -1
index 9831a592bbb9..15cb0b6bfe4f 100644
@@ -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
 	/*
Signature · 1 line
2.13.6
#1 lore raw

PATCH 1/1 nvme: Setup streams after initializing namespace head

Keith,

Quoted 1 line

Fixes a NULL pointer dereference.

Reviewed-by Martin K. Petersen <martin.petersen at oracle.com>
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
maintainer Applied
#2 lore raw

PATCH 1/1 nvme: Setup streams after initializing namespace head

Thanks, applied to nvme-4.15.