diff mbox series

cxl/hdm: unlock on error in cxl_decoder_commit()

Message ID Yvuv9wQrtXBy4Ddr@kili
State New, archived
Headers show
Series cxl/hdm: unlock on error in cxl_decoder_commit() | expand

Commit Message

Dan Carpenter Aug. 16, 2022, 2:55 p.m. UTC
Unlock on this error path before returning.

Fixes: 176baefb2eb5 ("cxl/hdm: Commit decoder state to hardware")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/cxl/core/hdm.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Dan Williams Aug. 16, 2022, 8:56 p.m. UTC | #1
Dan Carpenter wrote:
> Unlock on this error path before returning.
> 
> Fixes: 176baefb2eb5 ("cxl/hdm: Commit decoder state to hardware")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/cxl/core/hdm.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c
> index d1d2caea5c62..873c07386064 100644
> --- a/drivers/cxl/core/hdm.c
> +++ b/drivers/cxl/core/hdm.c
> @@ -605,6 +605,7 @@ static int cxl_decoder_commit(struct cxl_decoder *cxld)
>  
>  		rc = cxlsd_set_targets(cxlsd, &targets);
>  		if (rc) {
> +			up_read(&cxl_dpa_rwsem);
>  			dev_dbg(&port->dev, "%s: target configuration error\n",
>  				dev_name(&cxld->dev));
>  			goto err;
> -- 
> 2.35.1
> 

Yup, looks good, thanks!
diff mbox series

Patch

diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c
index d1d2caea5c62..873c07386064 100644
--- a/drivers/cxl/core/hdm.c
+++ b/drivers/cxl/core/hdm.c
@@ -605,6 +605,7 @@  static int cxl_decoder_commit(struct cxl_decoder *cxld)
 
 		rc = cxlsd_set_targets(cxlsd, &targets);
 		if (rc) {
+			up_read(&cxl_dpa_rwsem);
 			dev_dbg(&port->dev, "%s: target configuration error\n",
 				dev_name(&cxld->dev));
 			goto err;