[PATCH] bus: arm-integrator-lm: Add of_node_put() before return statement

Arnd Bergmann arnd at kernel.org
Fri Jan 15 12:22:07 EST 2021


From: Arnd Bergmann <arnd at arndb.de>

On Tue, 12 Jan 2021 10:25:49 +0100, Linus Walleij wrote:
> Every iteration of for_each_available_child_of_node() decrements
> the reference count of the previous node, however when control is
> transferred from the middle of the loop, as in the case of a return
> or break or goto, there is no decrement thus ultimately resulting in
> a memory leak.
> 
> Fix a potential memory leak in arm-integrator-lm.c by inserting
> of_node_put() before a return statement.
> 
> [...]

Applied to arm/fixes, thanks!

[1/1] bus: arm-integrator-lm: Add of_node_put() before return statement
      commit: 1740e6736922cc1a5d061cc4240d08eacfbbaa71

       Arnd



More information about the linux-arm-kernel mailing list