Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 654b4a4a authored by Keith Busch's avatar Keith Busch Committed by Christoph Hellwig
Browse files

nvme: setup streams after initializing namespace head



Fixes a NULL pointer dereference.

Reported-by: default avatarArnav Dawn <a.dawn@samsung.com>
Signed-off-by: default avatarKeith Busch <keith.busch@intel.com>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 249159c5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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
	/*