From: Christoph Hellwig Date: Fri, 12 Mar 2021 19:55:36 +0000 (+0100) Subject: nvme: fix the nsid value to print in nvme_validate_or_alloc_ns X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f4f9fc29e56b6fa9d7fa65ec51d3c82aff99c99b;p=linux.git nvme: fix the nsid value to print in nvme_validate_or_alloc_ns ns can be NULL at this point, and my move of the check from the original patch by Chaitanya broke this. Fixes: 0ec84df4953b ("nvme-core: check ctrl css before setting up zns") Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe --- diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 82ad5eef9d0c3..a5653892d7739 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -4099,7 +4099,7 @@ static void nvme_validate_or_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid) if (!nvme_multi_css(ctrl)) { dev_warn(ctrl->device, "command set not reported for nsid: %d\n", - ns->head->ns_id); + nsid); break; } nvme_alloc_ns(ctrl, nsid, &ids);