linux_dsm_epyc7002/drivers/nvme/host
Niklas Cassel 132be62387 nvme: prevent double free in nvme_alloc_ns() error handling
When jumping to the out_put_disk label, we will call put_disk(), which will
trigger a call to disk_release(), which calls blk_put_queue().

Later in the cleanup code, we do blk_cleanup_queue(), which will also call
blk_put_queue().

Putting the queue twice is incorrect, and will generate a KASAN splat.

Set the disk->queue pointer to NULL, before calling put_disk(), so that the
first call to blk_put_queue() will not free the queue.

The second call to blk_put_queue() uses another pointer to the same queue,
so this call will still free the queue.

Fixes: 85136c0102 ("lightnvm: simplify geometry enumeration")
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2020-04-27 17:08:06 +02:00
..
core.c nvme: prevent double free in nvme_alloc_ns() error handling 2020-04-27 17:08:06 +02:00
fabrics.c nvme-fabrics: Use scnprintf() for avoiding potential buffer overflow 2020-03-26 04:51:55 +09:00
fabrics.h nvme: Remove ADMIN_ONLY state 2019-10-14 23:21:44 +09:00
fault_inject.c nvme: enable to inject errors into admin commands 2019-06-21 11:15:50 +02:00
fc.c nvme-fc: Revert "add module to ops template to allow module references" 2020-04-04 09:09:39 +02:00
hwmon.c nvme: hwmon: switch to use <linux/units.h> helpers 2020-01-31 10:30:40 -08:00
Kconfig nvme: Don't deter users from enabling hwmon support 2020-03-26 04:45:25 +09:00
lightnvm.c lightnvm: move metadata mapping to lower level driver 2019-08-06 08:20:10 -06:00
Makefile nvme: Add hardware monitoring support 2019-11-12 01:57:35 +09:00
multipath.c nvme: fix deadlock caused by ANA update wrong locking 2020-04-04 09:07:03 +02:00
nvme.h nvme: Fix controller creation races with teardown flow 2020-03-26 04:51:56 +09:00
pci.c nvme: Make nvme_uninit_ctrl symmetric to nvme_init_ctrl 2020-03-26 04:51:56 +09:00
rdma.c block-5.7-2020-04-10 2020-04-10 10:06:54 -07:00
tcp.c nvme-tcp: fix possible crash in recv error flow 2020-04-01 11:07:13 +02:00
trace.c nvme: trace: parse Get LBA Status command in detail 2019-08-29 12:55:01 -07:00
trace.h nvme-trace: print result and status in hex format 2019-06-21 11:12:37 +02:00