Skip to contentSkip to conversation

media: qcom: camss: Fix potential crash if domain attach fails

PATCH New Vikram Sharma 1 participant 1 message Sep 30, 2024 1 message not in the archive

Subsystems (5)
lore
Share & tools
lore
#1 lore raw

PATCH v3 3/10 media: qcom: camss: Fix potential crash if domain attach fails

In reply to a message not in the archive

Fix a potential crash in camss by ensuring detach is skipped if attach is unsuccessful.

Fixes d89751c61279 ("media: qcom: camss: Add support for named power-domains")
---
 drivers/media/platform/qcom/camss/camss.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/media/platform/qcom/camss/camss.c +2 -3
index d64985ca6e88..b6658df37709 100644
@@ -2131,8 +2131,7 @@ static int camss_configure_pd(struct camss *camss)
 		camss->genpd = dev_pm_domain_attach_by_name(camss->dev,
 							    camss->res->pd_name);
 		if (IS_ERR(camss->genpd)) {
-			ret = PTR_ERR(camss->genpd);
-			goto fail_pm;
+			return PTR_ERR(camss->genpd);
 		}
 	}
 
@@ -2149,7 +2148,7 @@ static int camss_configure_pd(struct camss *camss)
 			ret = -ENODEV;
 		else
 			ret = PTR_ERR(camss->genpd);
-		goto fail_pm;
+		return ret;
 	}
 	camss->genpd_link = device_link_add(camss->dev, camss->genpd,
 					    DL_FLAG_STATELESS | DL_FLAG_PM_RUNTIME |
Signature · 1 line
2.25.1