From: Srinivas Kandagatla <srini@kernel.org>
To: Wentao Liang <vulab@iscas.ac.cn>, gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org, miquel.raynal@bootlin.com,
srini@kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] nvmem: layouts: onie-tlv: Fix np reference leak in onie_tlv_add_cells()
Date: Fri, 18 Sep 2026 22:40:46 +0100 [thread overview]
Message-ID: <6b916ff3-aeed-4d7e-af81-65ba8cb6d66f@kernel.org> (raw)
In-Reply-To: <20260917123514.2151346-1-vulab@iscas.ac.cn>
On 9/17/26 1:35 PM, Wentao Liang wrote:
> of_get_child_by_name() returns a node with an elevated reference count.
> nvmem_add_one_cell() only takes ownership of that reference on success,
> so the caller must drop it when the call fails. Add the missing
> of_node_put() before returning so that cell.np is not leaked.
>
Same comment, do not waste time with duplicate patches.
--srini
> Fixes: d3c0d12f6474 ("nvmem: layouts: onie-tlv: Add new layout driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
> drivers/nvmem/layouts/onie-tlv.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/nvmem/layouts/onie-tlv.c b/drivers/nvmem/layouts/onie-tlv.c
> index 0967a32319a2..3d77680f089b 100644
> --- a/drivers/nvmem/layouts/onie-tlv.c
> +++ b/drivers/nvmem/layouts/onie-tlv.c
> @@ -128,6 +128,7 @@ static int onie_tlv_add_cells(struct device *dev, struct nvmem_device *nvmem,
>
> ret = nvmem_add_one_cell(nvmem, &cell);
> if (ret) {
> + of_node_put(cell.np);
> of_node_put(layout);
> return ret;
> }
prev parent reply other threads:[~2026-09-18 21:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 12:35 Wentao Liang
2026-09-18 21:40 ` Srinivas Kandagatla [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=6b916ff3-aeed-4d7e-af81-65ba8cb6d66f@kernel.org \
--to=srini@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miquel.raynal@bootlin.com \
--cc=stable@vger.kernel.org \
--cc=vulab@iscas.ac.cn \
/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®