All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: zhaofeng2 <zhaofeng2@cmss.chinamobile.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH 2/3] PCI: keystone: Fix device node leak in ks_pcie_set_mode()
Date: Tue, 10 Nov 2026 10:18:20 +0000	[thread overview]
Message-ID: <sashiko-outbox-206852@kernel.org> (raw)
In-Reply-To: <20261110100955.1046-3-zhaofeng2@cmss.chinamobile.com>

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [Medium] PCI: keystone: OF node leak in ks_pcie_init_id() [1]
--

commit adfea56e642f99fd836f33feabf3e85f9ea278a1
Author: Zhao Feng <zhaofeng2@cmss.chinamobile.com>

PCI: keystone: Fix device node leak in ks_pcie_set_mode()

This commit adds an of_node_put() call in ks_pcie_set_mode() to drop the
syscon device node reference acquired by
of_parse_phandle_with_fixed_args().

> diff --git a/drivers/pci/controller/dwc/pci-keystone.c b/drivers/pci/controller/dwc/pci-keystone.c
> index 832589152570a..12c6f7d9a64bf 100644
> --- a/drivers/pci/controller/dwc/pci-keystone.c
> +++ b/drivers/pci/controller/dwc/pci-keystone.c
> @@ -1029,8 +1029,10 @@ static int ks_pcie_set_mode(struct device *dev)
>  
>  	/* Do not error out to maintain old DT compatibility */
>  	ret = of_parse_phandle_with_fixed_args(np, "ti,syscon-pcie-mode", 1, 0, &args);
> -	if (!ret)
> +	if (!ret) {
>  		offset = args.args[0];
> +		of_node_put(args.np);
> +	}

[Severity: Medium]
This problem wasn't introduced by this patch, but does the same
args.np device node reference leak [1] remain in ks_pcie_init_id()
and ks_pcie_am654_set_mode()?  Both functions also call
of_parse_phandle_with_fixed_args() to read args.args[0] without calling
of_node_put(args.np), leaking the syscon node reference on probe.

[1] https://sashiko.dev/#/bug/linux-2281dc7f-5c66-431f-8423-64e501436da0

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261110100955.1046-1-zhaofeng2@cmss.chinamobile.com?part=2

  reply	other threads:[~2026-11-10 10:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 10:09 [PATCH 0/3] PCI: keystone: Fix device node leaks in syscon phandle parsing zhaofeng2
2026-11-10 10:09 ` [PATCH 1/3] PCI: keystone: Fix device node leak in ks_pcie_init_id() zhaofeng2
2026-11-10 10:19   ` sashiko-bot
2026-11-10 10:09 ` [PATCH 2/3] PCI: keystone: Fix device node leak in ks_pcie_set_mode() zhaofeng2
2026-11-10 10:18   ` sashiko-bot [this message]
2026-11-10 10:09 ` [PATCH 3/3] PCI: keystone: Fix device node leak in ks_pcie_am654_set_mode() zhaofeng2
2026-11-10 10:14   ` sashiko-bot

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=sashiko-outbox-206852@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=zhaofeng2@cmss.chinamobile.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.