Skip to content

Commit 70096b4

Browse files
krzkandersson
authored andcommitted
soc: qcom: smem_state: fix missing of_node_put in error path
If of_parse_phandle_with_args() succeeds, the OF node reference should be dropped, regardless of number of phandle arguments. Cc: [email protected] Fixes: 9460ae2 ("soc: qcom: Introduce common SMEM state machine code") Signed-off-by: Krzysztof Kozlowski <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent 35d8bc1 commit 70096b4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/soc/qcom/smem_state.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ struct qcom_smem_state *qcom_smem_state_get(struct device *dev,
112112

113113
if (args.args_count != 1) {
114114
dev_err(dev, "invalid #qcom,smem-state-cells\n");
115-
return ERR_PTR(-EINVAL);
115+
state = ERR_PTR(-EINVAL);
116+
goto put;
116117
}
117118

118119
state = of_node_to_state(args.np);

0 commit comments

Comments
 (0)