WSL2-Linux-Kernel/drivers/cxl
Dan Williams 181c78d6c1 cxl/pmem: Fix reference counting for delayed work
commit 08b9e0ab8a upstream.

There is a potential race between queue_work() returning and the
queued-work running that could result in put_device() running before
get_device(). Introduce the cxl_nvdimm_bridge_state_work() helper that
takes the reference unconditionally, but drops it if no new work was
queued, to keep the references balanced.

Fixes: 8fdcb1704f ("cxl/pmem: Add initial infrastructure for pmem support")
Cc: <stable@vger.kernel.org>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Ben Widawsky <ben.widawsky@intel.com>
Link: https://lore.kernel.org/r/163553734757.2509761.3305231863616785470.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-27 11:02:58 +01:00
..
core cxl for v5.15 2021-09-09 11:48:27 -07:00
Kconfig cxl/pmem: Add initial infrastructure for pmem support 2021-06-15 16:47:14 -07:00
Makefile cxl: Move cxl_core to new directory 2021-08-06 08:22:53 -07:00
acpi.c cxl/acpi: Do not add DSDT disabled ACPI0016 host bridge ports 2021-09-07 11:39:01 -07:00
cxl.h cxl/pci: Simplify register setup 2021-08-06 08:27:02 -07:00
cxlmem.h cxl/mem: Account for partitionable space in ram/pmem ranges 2021-08-10 11:57:59 -07:00
pci.c cxl/pci: Fix NULL vs ERR_PTR confusion 2021-11-18 19:16:04 +01:00
pci.h cxl/pci: Simplify register setup 2021-08-06 08:27:02 -07:00
pmem.c cxl/pmem: Fix reference counting for delayed work 2022-01-27 11:02:58 +01:00