[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20190723.133800.1018088006261406860.davem@davemloft.net>
Date: Tue, 23 Jul 2019 13:38:00 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: nishkadg.linux@...il.com
Cc: andrew@...n.ch, vivien.didelot@...il.com, f.fainelli@...il.com,
netdev@...r.kernel.org
Subject: Re: [PATCH] net: dsa: mv88e6xxx: chip: Add of_node_put() before
return
From: Nishka Dasgupta <nishkadg.linux@...il.com>
Date: Tue, 23 Jul 2019 16:13:07 +0530
> Each iteration of for_each_available_child_of_node puts the previous
> node, but in the case of a return from the middle of the loop, there is
> no put, thus causing a memory leak. Hence add an of_node_put before the
> return.
> Issue found with Coccinelle.
>
> Signed-off-by: Nishka Dasgupta <nishkadg.linux@...il.com>
Applied, but as I've repeatedly stated these OF node looping constructs
are EXTREMELY ERROR PRONE.
We must fix these kinds of interfaces so that they are easier to use
correctly.
Powered by blists - more mailing lists