Skip to contentSkip to conversation

cxl/hdm: unlock on error in cxl_decoder_commit()

PATCH In review Dan Carpenter 2 participants 2 messages Aug 16, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cxl/hdm: unlock on error in cxl_decoder_commit()

Unlock on this error path before returning.

Fixes 176baefb2eb5 ("cxl/hdm: Commit decoder state to hardware")
---
 drivers/cxl/core/hdm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/cxl/core/hdm.c +1 -0
index d1d2caea5c62..873c07386064 100644
@@ -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;
Signature · 1 line
2.35.1
#1 lore raw
Quoted 23 lines · Dan Carpenter

Unlock on this error path before returning.

Fixes 176baefb2eb5 ("cxl/hdm: Commit decoder state to hardware")
---
 drivers/cxl/core/hdm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/cxl/core/hdm.c +1 -0
index d1d2caea5c62..873c07386064 100644
@@ -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;
Signature · 1 line
2.35.1

Yup, looks good, thanks!