diff mbox series

bus: qcom: ebi2: fix device node iterator leak

Message ID 20200925234504.GA18813@agrajag.zerfleddert.de (mailing list archive)
State Accepted
Commit 4f26f0c36fe2ffd19d951837767d64ab6c621df6
Headers show
Series bus: qcom: ebi2: fix device node iterator leak | expand

Commit Message

Tobias Jordan Sept. 25, 2020, 11:45 p.m. UTC
In the for_each_available_child_of_node loop of qcom_ebi2_probe, add a
call to of_node_put to avoid leaking the iterator if we bail out.

Fixes: 335a12754808 ("bus: qcom: add EBI2 driver")

Signed-off-by: Tobias Jordan <kernel@cdqe.de>
---
 drivers/bus/qcom-ebi2.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Linus Walleij Sept. 29, 2020, 8:46 p.m. UTC | #1
On Sat, Sep 26, 2020 at 1:45 AM Tobias Jordan <kernel@cdqe.de> wrote:

> In the for_each_available_child_of_node loop of qcom_ebi2_probe, add a
> call to of_node_put to avoid leaking the iterator if we bail out.
>
> Fixes: 335a12754808 ("bus: qcom: add EBI2 driver")
>
> Signed-off-by: Tobias Jordan <kernel@cdqe.de>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Bjorn can you apply this to the Qualcomm SoC tree?

Yours,
Linus Walleij
patchwork-bot+linux-arm-msm@kernel.org March 11, 2021, 7:40 p.m. UTC | #2
Hello:

This patch was applied to qcom/linux.git (refs/heads/for-next):

On Sat, 26 Sep 2020 01:45:04 +0200 you wrote:
> In the for_each_available_child_of_node loop of qcom_ebi2_probe, add a
> call to of_node_put to avoid leaking the iterator if we bail out.
> 
> Fixes: 335a12754808 ("bus: qcom: add EBI2 driver")
> 
> Signed-off-by: Tobias Jordan <kernel@cdqe.de>
> 
> [...]

Here is the summary with links:
  - bus: qcom: ebi2: fix device node iterator leak
    https://git.kernel.org/qcom/c/4f26f0c36fe2

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

diff --git a/drivers/bus/qcom-ebi2.c b/drivers/bus/qcom-ebi2.c
index 03ddcf426887..0b8f53a688b8 100644
--- a/drivers/bus/qcom-ebi2.c
+++ b/drivers/bus/qcom-ebi2.c
@@ -353,8 +353,10 @@  static int qcom_ebi2_probe(struct platform_device *pdev)
 
 		/* Figure out the chipselect */
 		ret = of_property_read_u32(child, "reg", &csindex);
-		if (ret)
+		if (ret) {
+			of_node_put(child);
 			return ret;
+		}
 
 		if (csindex > 5) {
 			dev_err(dev,