Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cxl/pmem: Fix reference counting for delayed work
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: 8fdcb17 ("cxl/pmem: Add initial infrastructure for pmem support") Cc: <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Reviewed-by: Ben Widawsky <[email protected]> Link: https://lore.kernel.org/r/163553734757.2509761.3305231863616785470.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams <[email protected]>
- Loading branch information