Re: [PATCH v4 1/3] cxl/core/region: move pmem region driver logic into region_pmem.c

From: Gregory Price

Date: Mon Mar 23 2026 - 12:26:24 EST


On Mon, Mar 23, 2026 at 03:08:47PM +0000, Jonathan Cameron wrote:
> On Sun, 22 Mar 2026 09:16:36 -0400
> Gregory Price <gourry@xxxxxxxxxx> wrote:
>
> > + scoped_guard(device, &cxl_nvb->dev) {
> > + if (cxl_nvb->dev.driver)
> > + rc = devm_add_action_or_reset(&cxl_nvb->dev,
> > + cxlr_pmem_unregister,
> > + cxlr_pmem);
> > + else
> > + rc = -ENXIO;
> As an example. If we happen to take this path... Where is the device_add() undone?

In many other parts of the code, device_add is not rolled back either
"for reasons", and - depending on who you talk to - this is
intentional... for debugging?

I dunno, but the "hanging objects on failure" thing is common throughout
cxl/ - :shrug:

~Gregory