[PATCH] soc: qcom: smem_state: fix missing of_node_put in error path

Krzysztof Kozlowski posted 1 patch 1 year, 5 months ago
drivers/soc/qcom/smem_state.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH] soc: qcom: smem_state: fix missing of_node_put in error path
Posted by Krzysztof Kozlowski 1 year, 5 months ago
If of_parse_phandle_with_args() succeeds, the OF node reference should
be dropped, regardless of number of phandle arguments.

Cc: <stable@vger.kernel.org>
Fixes: 9460ae2ff308 ("soc: qcom: Introduce common SMEM state machine code")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/soc/qcom/smem_state.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/smem_state.c b/drivers/soc/qcom/smem_state.c
index d9bfac6c54fb..cc5be8019b6a 100644
--- a/drivers/soc/qcom/smem_state.c
+++ b/drivers/soc/qcom/smem_state.c
@@ -112,7 +112,8 @@ struct qcom_smem_state *qcom_smem_state_get(struct device *dev,
 
 	if (args.args_count != 1) {
 		dev_err(dev, "invalid #qcom,smem-state-cells\n");
-		return ERR_PTR(-EINVAL);
+		state = ERR_PTR(-EINVAL);
+		goto put;
 	}
 
 	state = of_node_to_state(args.np);
-- 
2.43.0
Re: (subset) [PATCH] soc: qcom: smem_state: fix missing of_node_put in error path
Posted by Bjorn Andersson 1 year, 1 month ago
On Thu, 22 Aug 2024 18:48:51 +0200, Krzysztof Kozlowski wrote:
> If of_parse_phandle_with_args() succeeds, the OF node reference should
> be dropped, regardless of number of phandle arguments.
> 
> 

Applied, thanks!

[1/1] soc: qcom: smem_state: fix missing of_node_put in error path
      commit: 70096b4990848229d0784c5e51dc3c7c072f1111

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>
Re: (subset) [PATCH] soc: qcom: smem_state: fix missing of_node_put in error path
Posted by Bjorn Andersson 1 year, 1 month ago
On Thu, 22 Aug 2024 18:48:51 +0200, Krzysztof Kozlowski wrote:
> If of_parse_phandle_with_args() succeeds, the OF node reference should
> be dropped, regardless of number of phandle arguments.
> 
> 

Applied, thanks!

[1/1] soc: qcom: smem_state: fix missing of_node_put in error path
      commit: 70096b4990848229d0784c5e51dc3c7c072f1111

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>
Re: (subset) [PATCH] soc: qcom: smem_state: fix missing of_node_put in error path
Posted by Bjorn Andersson 1 year, 4 months ago
On Thu, 22 Aug 2024 18:48:51 +0200, Krzysztof Kozlowski wrote:
> If of_parse_phandle_with_args() succeeds, the OF node reference should
> be dropped, regardless of number of phandle arguments.
> 
> 

Applied, thanks!

[2/3] soc: qcom: pbs: simplify locking with guard()
      commit: 6187aaae71ec236163d96601b37216e110bf7554
[3/3] soc: qcom: smem_state: simplify locking with guard()
      commit: cd3a3e60ebfe6f62ccf9d2164f6455e0b1ae1884

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>
Re: [PATCH] soc: qcom: smem_state: fix missing of_node_put in error path
Posted by Krzysztof Kozlowski 1 year, 5 months ago
On 22/08/2024 18:48, Krzysztof Kozlowski wrote:
> If of_parse_phandle_with_args() succeeds, the OF node reference should
> be dropped, regardless of number of phandle arguments.
> 
> Cc: <stable@vger.kernel.org>
> Fixes: 9460ae2ff308 ("soc: qcom: Introduce common SMEM state machine code")
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---

And this one patch is a duplicate of what I sent separately. Can be
ignored. Sorry for the mess, time to finish work for today. :(

Best regards,
Krzysztof