Skip to content

Commit

Permalink
soc: qcom: smem_state: fix missing of_node_put in error path
Browse files Browse the repository at this point in the history
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: 9460ae2 ("soc: qcom: Introduce common SMEM state machine code")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20240822164853.231087-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
  • Loading branch information
Krzysztof Kozlowski authored and Bjorn Andersson committed Dec 26, 2024
1 parent 35d8bc1 commit 70096b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/soc/qcom/smem_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 70096b4

Please sign in to comment.