nvme: Fix NULL dereference on reservation request
authorKeith Busch <keith.busch@intel.com>
Thu, 16 Nov 2017 20:36:49 +0000 (13:36 -0700)
committerChristoph Hellwig <hch@lst.de>
Mon, 20 Nov 2017 07:38:11 +0000 (08:38 +0100)
commitb0d61d586f09fd814a45a5d778fe0d6123f67c2a
tree475f348d8742332afb1cee36185892ec17ac97f6
parent89c4aff6d4f71726f22e567f046dc1dd73c35de1
nvme: Fix NULL dereference on reservation request

This fixes using the NULL 'head' before getting the reference. It is
however possible the head will always be NULL, so this patch uses the
struct nvme_ns to get the ns_id field.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/core.c