]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
nvme: fix the nsid value to print in nvme_validate_or_alloc_ns
authorChristoph Hellwig <hch@lst.de>
Fri, 12 Mar 2021 19:55:36 +0000 (20:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Mar 2021 12:30:31 +0000 (14:30 +0200)
commit f4f9fc29e56b6fa9d7fa65ec51d3c82aff99c99b upstream.

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 <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvme/host/core.c

index c611a17e83f00cbbf01839885125aa4186709dd0..6199bce5d3a4fb66ba1c5c935a9ec213153abbc6 100644 (file)
@@ -4072,7 +4072,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);