From bdadd5e009ee71b8755aab6c5db46b33e97d64ac Mon Sep 17 00:00:00 2001 From: "Isaac J. Manjarres" Date: Wed, 18 Sep 2019 13:13:13 -0700 Subject: [PATCH] soc: qcom: pil: Correct memory-region of_node reference counting of_parse_phandle() is used to deduce if a memory region is associated with a particular device. The call to of_parse_phandle() internally increments the reference count to the memory region's of_node, and thus, the caller should reverse that action by decrementing it via a call to of_node_put(). Change-Id: I390b48bef9295258ae950738c0dde99d4604e263 Signed-off-by: Isaac J. Manjarres --- drivers/soc/qcom/peripheral-loader.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/soc/qcom/peripheral-loader.c b/drivers/soc/qcom/peripheral-loader.c index 7f033aa34526..191582af553d 100644 --- a/drivers/soc/qcom/peripheral-loader.c +++ b/drivers/soc/qcom/peripheral-loader.c @@ -779,6 +779,7 @@ static int pil_alloc_region(struct pil_priv *priv, phys_addr_t min_addr, } ret = of_address_to_resource(mem_node, 0, &res); + of_node_put(mem_node); if (ret < 0) { pil_err(priv->desc, "Failed to get the resource\n"); goto err;