Re: [PATCH v2] dma: qcom: hidma_mgmt: Add of_node_put() before goto

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 24-07-19, 13:25, Sinan Kaya wrote:
> On 7/24/2019 4:16 AM, Nishka Dasgupta wrote:
> > Each iteration of for_each_available_child_of_node puts the previous
> > node, but in the case of a goto from the middle of the loop, there is
> > no put, thus causing a memory leak. 
> > Hence add an of_node_put under the label that the gotos point to.
> > In order to avoid decrementing an already-decremented refcount, copy the
> > original contents of the label (including the return statement) to just
> > above the label, so that the code under the label is executed only when
> > a goto exit from the loop occurs.
> > Additionally, remove an unnecessary get/put pair from the loop, as the
> > loop itself already keeps track of refcount.
> > Issue found with Coccinelle.
> > 
> > Signed-off-by: Nishka Dasgupta <nishkadg.linux@xxxxxxxxx>
> 
> nit: please post v3 with dmaengine:qcom:hidma_mgmt:....
> 
> Vinod doesn't like commit subjectss in this directory to have dma name
> on it. You can keep my acked-by.

That's right but I am okay to hand edit while applying for drive by
contributors :) so applied with you ack

> Acked-by: Sinan Kaya <okaya@xxxxxxxxxx>
> 

-- 
~Vinod



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux