All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: frowand.list@gmail.com
Cc: pantelis.antoniou@konsulko.com, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Michael Ellerman <mpe@ellerman.id.au>,
	"Erhard F." <erhard_f@mailbox.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Alan Tull <atull@kernel.org>
Subject: Re: [PATCH 5/5] of: unittest: kmemleak in duplicate property update
Date: Thu, 16 Apr 2020 17:11:10 -0500	[thread overview]
Message-ID: <20200416221110.GA8899@bogus> (raw)
In-Reply-To: <1587073370-25963-6-git-send-email-frowand.list@gmail.com>

On Thu, 16 Apr 2020 16:42:50 -0500, frowand.list@gmail.com wrote:
> From: Frank Rowand <frank.rowand@sony.com>
> 
> kmemleak reports several memory leaks from devicetree unittest.
> This is the fix for problem 5 of 5.
> 
> When overlay 'overlay_bad_add_dup_prop' is applied, the apply code
> properly detects that a memory leak will occur if the overlay is removed
> since the duplicate property is located in a base devicetree node and
> reports via printk():
> 
>   OF: overlay: WARNING: memory leak will occur if overlay removed, property: /testcase-data-2/substation@100/motor-1/rpm_avail
>   OF: overlay: WARNING: memory leak will occur if overlay removed, property: /testcase-data-2/substation@100/motor-1/rpm_avail
> 
> The overlay is removed when the apply code detects multiple changesets
> modifying the same property.  This is reported via printk():
> 
>   OF: overlay: ERROR: multiple fragments add, update, and/or delete property /testcase-data-2/substation@100/motor-1/rpm_avail
> 
> As a result of this error, the overlay is removed resulting in the
> expected memory leak.
> 
> Add another device node level to the overlay so that the duplicate
> property is located in a node added by the overlay, thus no memory
> leak will occur when the overlay is removed.
> 
> Thus users of kmemleak will not have to debug this leak in the future.
> 
> Fixes: 2fe0e8769df9 ("of: overlay: check prevents multiple fragments touching same property")
> Reported-by: Erhard F. <erhard_f@mailbox.org>
> Signed-off-by: Frank Rowand <frank.rowand@sony.com>
> ---
>  .../of/unittest-data/overlay_bad_add_dup_prop.dts  | 23 ++++++++++++++++++----
>  drivers/of/unittest.c                              | 12 +++++------
>  2 files changed, 25 insertions(+), 10 deletions(-)
> 

Applied, thanks.

Rob

  reply	other threads:[~2020-04-16 22:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-16 21:42 [PATCH 0/5] of: unittest: kmleak detected memory leaks frowand.list
2020-04-16 21:42 ` [PATCH 1/5] of: unittest: kmemleak on changeset destroy frowand.list
2020-04-16 21:42 ` [PATCH 2/5] of: unittest: kmemleak in of_unittest_platform_populate() frowand.list
2020-04-16 21:42 ` [PATCH 3/5] of: unittest: kmemleak in of_unittest_overlay_high_level() frowand.list
2020-04-16 21:42 ` [PATCH 4/5] of: overlay: kmemleak in dup_and_fixup_symbol_prop() frowand.list
2020-04-16 21:42 ` [PATCH 5/5] of: unittest: kmemleak in duplicate property update frowand.list
2020-04-16 22:11   ` Rob Herring [this message]
2020-04-16 22:10 ` [PATCH 0/5] of: unittest: kmleak detected memory leaks Rob Herring

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=20200416221110.GA8899@bogus \
    --to=robh@kernel.org \
    --cc=atull@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=erhard_f@mailbox.org \
    --cc=frowand.list@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=pantelis.antoniou@konsulko.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.