nvme: fix lightnvm check
authorChristoph Hellwig <hch@lst.de>
Wed, 6 Sep 2017 09:45:24 +0000 (11:45 +0200)
committerChristoph Hellwig <hch@lst.de>
Mon, 11 Sep 2017 16:29:36 +0000 (12:29 -0400)
commit608cc4b14aeadcf3e4dc325fc211b7052e74b50c
tree19f45967e83e8b033f1c3e60eef0f7c78047d41c
parent09c2c359be546df45be0b158ea1d3cc8ea83c876
nvme: fix lightnvm check

nvme_nvm_ns_supported assumes every device is a pci_dev, which leads to
reading an incorrect field, or possible even a dereference of unallocated
memory for fabrics controllers.

Fix this by introducing a quirk for lighnvm capable devices instead.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Matias Bjørling <mb@lightnvm.io>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
drivers/nvme/host/core.c
drivers/nvme/host/lightnvm.c
drivers/nvme/host/nvme.h
drivers/nvme/host/pci.c