mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrea della Porta <andrea.porta@suse.com>
To: Wentao Liang <vulab@iscas.ac.cn>
Cc: andrea.porta@suse.com, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, robh@kernel.org,
	saravanak@kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] of: unittest: Fix np reference leak in of_unittest_pci_empty_dma_ranges()
Date: Thu, 17 Sep 2026 16:33:18 +0200	[thread overview]
Message-ID: <aqv6Lv5EZrziJVOR@apocalypse> (raw)
In-Reply-To: <20260917130307.2152615-1-vulab@iscas.ac.cn>

Hi Wentao,

On 13:03 Thu 17 Sep     , Wentao Liang wrote:
> of_pci_dma_range_parser_init() can fail when the node lacks a dma-ranges
> property. That error path returns without dropping the reference taken
> by of_find_node_by_path(). Add the missing of_node_put().
> 
> Fixes: 1a75e81baf4f ("of/unittest: Add empty dma-ranges address translation tests")
> Cc: stable@vger.kernel.org
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
>  drivers/of/unittest.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
> index 939cbff45ab1..6bc5babddf0a 100644
> --- a/drivers/of/unittest.c
> +++ b/drivers/of/unittest.c
> @@ -1250,6 +1250,7 @@ static void __init of_unittest_pci_empty_dma_ranges(void)
>  
>  	if (of_pci_dma_range_parser_init(&parser, np)) {
>  		pr_err("missing dma-ranges property\n");
> +		of_node_put(np);
>  		return;
>  	}
>  
> -- 
> 2.34.1
>

Thanks for your patch!

Reviewed-by: Andrea della Porta <andrea.porta@suse.com>

      reply	other threads:[~2026-09-17 14:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17 13:03 Wentao Liang
2026-09-17 14:33 ` Andrea della Porta [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=aqv6Lv5EZrziJVOR@apocalypse \
    --to=andrea.porta@suse.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=saravanak@kernel.org \
    --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®