diff options
author | Dan Williams <dan.j.williams@intel.com> | 2022-05-19 01:34:31 +0200 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2022-05-19 17:50:41 +0200 |
commit | 76a4121e86649bf381aa32cb69ede913def57202 (patch) | |
tree | e3febe01a9f567d736a29f5f8734d06b1748d7c5 /drivers/cxl | |
parent | cxl/pci: Drop wait_for_valid() from cxl_await_media_ready() (diff) | |
download | linux-76a4121e86649bf381aa32cb69ede913def57202.tar.xz linux-76a4121e86649bf381aa32cb69ede913def57202.zip |
cxl/mem: Fix cxl_mem_probe() error exit
The addition of cxl_mem_active() broke error exit scenarios for
cxl_mem_probe(). Return early rather than proceed with disabling
suspend, and update the label name since it is no longer a terminal
"out" label that exits the function.
Fixes: 9ea4dcf49878 ("PM: CXL: Disable suspend")
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/165291687176.1426646.15449254938752532784.stgit@dwillia2-xfh
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/cxl')
-rw-r--r-- | drivers/cxl/mem.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/cxl/mem.c b/drivers/cxl/mem.c index 7622cfefa1b0..184549e5093f 100644 --- a/drivers/cxl/mem.c +++ b/drivers/cxl/mem.c @@ -171,13 +171,15 @@ static int cxl_mem_probe(struct device *dev) dev_err(dev, "CXL port topology %s not enabled\n", dev_name(&parent_port->dev)); rc = -ENXIO; - goto out; + goto unlock; } rc = create_endpoint(cxlmd, parent_port); -out: +unlock: device_unlock(&parent_port->dev); put_device(&parent_port->dev); + if (rc) + return rc; /* * The kernel may be operating out of CXL memory on this device, |