From: David Miller <davem@davemloft.net>
To: sylphrenadin@gmail.com
Cc: andrew@lunn.ch, f.fainelli@gmail.com, netdev@vger.kernel.org,
sean.wang@mediatek.com, linux-kernel@vger.kernel.org,
Julia.Lawall@lip6.fr, linux-mediatek@lists.infradead.org,
matthias.bgg@gmail.com, kuba@kernel.org,
vivien.didelot@gmail.com, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH V4] net: dsa: mt7530: Add of_node_put() before break and return statements
Date: Tue, 25 Aug 2020 07:48:42 -0700 (PDT) [thread overview]
Message-ID: <20200825.074842.773732876988634467.davem@davemloft.net> (raw)
In-Reply-To: <20200824200311.GA19436@Kaladin>
From: Sumera Priyadarsini <sylphrenadin@gmail.com>
Date: Tue, 25 Aug 2020 01:33:11 +0530
> Every iteration of for_each_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 mt7530.c by inserting of_node_put()
> before the break and return statements.
>
> Issue found with Coccinelle.
>
> Signed-off-by: Sumera Priyadarsini <sylphrenadin@gmail.com>
Applied, thank you.
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
prev parent reply other threads:[~2020-08-25 14:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-24 20:03 [PATCH V4] net: dsa: mt7530: Add of_node_put() before break and return statements Sumera Priyadarsini
2020-08-25 14:48 ` David Miller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200825.074842.773732876988634467.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=Julia.Lawall@lip6.fr \
--cc=andrew@lunn.ch \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=sean.wang@mediatek.com \
--cc=sylphrenadin@gmail.com \
--cc=vivien.didelot@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox