soc: qcom: pmic_glink: fix OF node leak
Subsystems (2)
PATCH 1/1 soc: qcom: pmic_glink: fix OF node leak
Make sure to drop the OF node reference taken when registering the auxiliary devices when the devices are later released.
Fixes 58ef4ece1e41 ("soc: qcom: pmic_glink: Introduce base PMIC GLINK driver")
Cc Bjorn Andersson <[email protected]>
Signed-off-by Johan Hovold <[email protected]>
--- drivers/soc/qcom/pmic_glink.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/soc/qcom/pmic_glink.c +7 -2
@@ -167,7 +167,10 @@ static int pmic_glink_rpmsg_callback(struct rpmsg_device *rpdev, void *data,return 0 ; } -static void pmic_glink_aux_release (struct device *dev) {} +static void pmic_glink_aux_release (struct device *dev) +{ +of_node_put (dev->of_node); +} static int pmic_glink_add_aux_device(struct pmic_glink *pg, struct auxiliary_device *aux,
@@ -181,8 +184,10 @@ static int pmic_glink_add_aux_device(struct pmic_glink *pg, aux->dev.release = pmic_glink_aux_release;device_set_of_node_from_dev (&aux->dev, parent); ret =auxiliary_device_init (aux); -if (ret) +if (ret) { +of_node_put (aux->dev.of_node);return ret; + } ret =auxiliary_device_add (aux);if (ret)
Signature · 1 line
2.49.0
Quoted 7 lines · Johan Hovold
Make sure to drop the OF node reference taken when registering the auxiliary devices when the devices are later released.
Fixes 58ef4ece1e41 ("soc: qcom: pmic_glink: Introduce base PMIC GLINK driver")Cc Bjorn Andersson <[email protected]>Signed-off-by Johan Hovold <[email protected]>---
Hmm.. maybe the auxdev APIs could one day do this internally
in any case
Reviewed-by Konrad Dybcio <[email protected]>
Konrad
Quoted 4 lines · Johan Hovold
Make sure to drop the OF node reference taken when registering the auxiliary devices when the devices are later released.
Applied, thanks!
[1/1] soc: qcom: pmic_glink: fix OF node leak
commit: 65702c3d293e45d3cac5e4e175296a9c90404326
Best regards,
Signature · 1 line
Bjorn Andersson <[email protected]>