All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cxl/hdm: unlock on error in cxl_decoder_commit()
@ 2022-08-16 14:55 Dan Carpenter
  2022-08-16 20:56 ` Dan Williams
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2022-08-16 14:55 UTC (permalink / raw)
  To: Alison Schofield, Dan Williams
  Cc: Vishal Verma, Ira Weiny, Ben Widawsky, Jonathan Cameron,
	Adam Manzanares, linux-cxl, kernel-janitors

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH] cxl/hdm: unlock on error in cxl_decoder_commit()
  2022-08-16 14:55 [PATCH] cxl/hdm: unlock on error in cxl_decoder_commit() Dan Carpenter
@ 2022-08-16 20:56 ` Dan Williams
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Williams @ 2022-08-16 20:56 UTC (permalink / raw)
  To: Dan Carpenter, Alison Schofield, Dan Williams
  Cc: Vishal Verma, Ira Weiny, Ben Widawsky, Jonathan Cameron,
	Adam Manzanares, linux-cxl, kernel-janitors

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!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-16 20:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-16 14:55 [PATCH] cxl/hdm: unlock on error in cxl_decoder_commit() Dan Carpenter
2022-08-16 20:56 ` Dan Williams

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.