From: Daniel Golle <daniel@makrotopia.org>
To: Vishal Satle <vishalsatleit24@gmail.com>
Cc: Richard Weinberger <richard@nod.at>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Vignesh Raghavendra <vigneshr@ti.com>,
Zhihao Cheng <chengzhihao1@huawei.com>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH] mtd: ubi: nvmem: Fix device_node leak in ubi_nvmem_add()
Date: Tue, 27 Oct 2026 09:18:38 +0000 [thread overview]
Message-ID: <auBsbmS11_TQTryC@makrotopia.org> (raw)
In-Reply-To: <20261027091507.130294-1-vishalsatleit24@gmail.com>
On Tue, Oct 27, 2026 at 02:45:07PM +0530, Vishal Satle wrote:
> ubi_nvmem_add() calls of_get_child_by_name() to verify that the UBI
> volume device node contains an "nvmem-layout" subnode.
> of_get_child_by_name() returns a pointer to the child device_node
> with its reference count incremented.
>
> Because the returned pointer was only evaluated as a boolean condition
> and not retained or put, the reference count of the "nvmem-layout" node
> was leaked whenever an NVMEM-enabled UBI volume was registered.
>
> Assign the child node to a local variable and release it with
> of_node_put() once existence has been validated.
>
> Fixes: 34a5d8525b6a ("mtd: ubi: add NVMEM support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Vishal Satle <vishalsatleit24@gmail.com>
Thanks for fixing this.
Reviewed-by: Daniel Golle <daniel@makrotopia.org>
next prev parent reply other threads:[~2026-10-27 9:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-27 9:15 Vishal Satle
2026-10-27 9:18 ` Daniel Golle [this message]
2026-10-27 11:18 ` Zhihao Cheng
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=auBsbmS11_TQTryC@makrotopia.org \
--to=daniel@makrotopia.org \
--cc=chengzhihao1@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=stable@vger.kernel.org \
--cc=vigneshr@ti.com \
--cc=vishalsatleit24@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
all inboxes | Powered by JetHome®