[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241011140932.1744124-4-quic_vikramsa@quicinc.com>
Date: Fri, 11 Oct 2024 19:39:27 +0530
From: Vikram Sharma <quic_vikramsa@...cinc.com>
To: <rfoss@...nel.org>, <todor.too@...il.com>, <bryan.odonoghue@...aro.org>,
<mchehab@...nel.org>, <robh@...nel.org>, <krzk+dt@...nel.org>,
<conor+dt@...nel.org>, <akapatra@...cinc.com>, <hariramp@...cinc.com>,
<andersson@...nel.org>, <konradybcio@...nel.org>,
<hverkuil-cisco@...all.nl>, <cros-qcom-dts-watchers@...omium.org>,
<catalin.marinas@....com>, <will@...nel.org>
CC: <linux-arm-kernel@...ts.infradead.org>, <quic_vikramsa@...cinc.com>,
<linux-media@...r.kernel.org>, <linux-arm-msm@...r.kernel.org>,
<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<kernel@...cinc.com>, <stable@...r.kernel.org>
Subject: [PATCH v3 3/8] media: qcom: camss: Fix potential crash if domain attach fails
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")
CC: stable@...r.kernel.org
Signed-off-by: Vikram Sharma <quic_vikramsa@...cinc.com>
---
drivers/media/platform/qcom/camss/camss.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
index d64985ca6e88..b6658df37709 100644
--- a/drivers/media/platform/qcom/camss/camss.c
+++ b/drivers/media/platform/qcom/camss/camss.c
@@ -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 |
--
2.25.1
Powered by blists - more mailing lists