diff mbox series

[04/14] cxl/mem: Fix cxl_mem_probe() error exit

Message ID 165237927776.3832067.18030972182050637940.stgit@dwillia2-desk3.amr.corp.intel.com
State Superseded
Headers show
Series cxl: Fix "mem_enable" handling | expand

Commit Message

Dan Williams May 12, 2022, 6:14 p.m. UTC
The addition of cxl_mem_active() broke error exit scenarios for
cxl_mem_probe(). Return early rather than proceed with disabling suspend.

Fixes: 9ea4dcf49878 ("PM: CXL: Disable suspend")
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/cxl/mem.c |    2 ++
 1 file changed, 2 insertions(+)

Comments

Jonathan Cameron May 18, 2022, 5:23 p.m. UTC | #1
On Thu, 12 May 2022 11:14:37 -0700
Dan Williams <dan.j.williams@intel.com> wrote:

> The addition of cxl_mem_active() broke error exit scenarios for
> cxl_mem_probe(). Return early rather than proceed with disabling suspend.
> 
> Fixes: 9ea4dcf49878 ("PM: CXL: Disable suspend")
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>

With or without rename of label

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
>  drivers/cxl/mem.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/cxl/mem.c b/drivers/cxl/mem.c
> index 7622cfefa1b0..fed7f10ef9b2 100644
> --- a/drivers/cxl/mem.c
> +++ b/drivers/cxl/mem.c
> @@ -178,6 +178,8 @@ static int cxl_mem_probe(struct device *dev)
>  out:
>  	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,
>
diff mbox series

Patch

diff --git a/drivers/cxl/mem.c b/drivers/cxl/mem.c
index 7622cfefa1b0..fed7f10ef9b2 100644
--- a/drivers/cxl/mem.c
+++ b/drivers/cxl/mem.c
@@ -178,6 +178,8 @@  static int cxl_mem_probe(struct device *dev)
 out:
 	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,