linux/drivers/nvme/host
Minwoo Im 95a7d23415 nvme-pci: fix NULL pointer dereference in nvme_free_host_mem()
[ Upstream commit 7e5dd57ef3 ]

Following condition which will cause NULL pointer dereference will
occur in nvme_free_host_mem() when it tries to remove pci device via
nvme_remove() especially after a failure of host memory allocation for HMB.

    "(host_mem_descs == NULL) && (nr_host_mem_descs != 0)"

It's because __nr_host_mem_descs__ is not cleared to 0 unlike
__host_mem_descs__ is so.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2018-02-03 17:39:10 +01:00
..
core.c nvme: use kref_get_unless_zero in nvme_find_get_ns 2017-12-20 10:10:31 +01:00
fabrics.c nvme-fabrics: Allow 0 as KATO value 2017-09-25 08:56:05 -06:00
fabrics.h nvme-fabrics: introduce init command check for a queue that is not alive 2018-02-03 17:38:57 +01:00
fc.c nvme-fc: check if queue is ready in queue_rq 2018-02-03 17:38:58 +01:00
Kconfig nvme: Remove SCSI translations 2017-06-28 08:14:13 -06:00
lightnvm.c nvme: fix lightnvm check 2017-09-11 12:29:36 -04:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nvme.h nvme-pci: add quirk for delay before CHK RDY for WDC SN200 2017-12-05 11:26:34 +01:00
pci.c nvme-pci: fix NULL pointer dereference in nvme_free_host_mem() 2018-02-03 17:39:10 +01:00
rdma.c nvme-rdma: don't complete requests before a send work request has completed 2018-02-03 17:39:02 +01:00