From: Andrea della Porta <andrea.porta@suse.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: krzk@kernel.org, Andrea della Porta <andrea.porta@suse.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Florian Fainelli <florian.fainelli@broadcom.com>,
Bjorn Helgaas <bhelgaas@google.com>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH v3] misc: rp1: Fix an error handling path in rp1_probe()
Date: Mon, 10 Nov 2025 12:02:14 +0100 [thread overview]
Message-ID: <aRHGNrth4GEu5J-_@apocalypse> (raw)
In-Reply-To: <9bc1206de787fa86384f3e5ba0a8027947bc00ff.1762585959.git.christophe.jaillet@wanadoo.fr>
Hi Christophe,
On 08:14 Sat 08 Nov , Christophe JAILLET wrote:
> When DT is used to get the reference of 'rp1_node', it should be released
> when not needed anymore, otherwise it is leaking.
>
> In such a case, add the missing of_node_put() call at the end of the probe,
> as already done in the error handling path.
>
> Fixes: 49d63971f963 ("misc: rp1: RaspberryPi RP1 misc driver")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> This patch is compile tested only.
>
> Changes in v3:
> - Don't use cleanup.h in this case [Krzysztof Kozlowski]
>
> Changes in v2:
> - implement Dan's suggestions [Dan Carpenter]
> v2: https://lore.kernel.org/lkml/8f55f8866a6680830c9d318201a29293ac50a591.1761334487.git.christophe.jaillet@wanadoo.fr/
>
> v1: https://lore.kernel.org/lkml/4e92a271fdb98560c4e659556a1f3e99e7d0d38e.1760987458.git.christophe.jaillet@wanadoo.fr/
> ---
> drivers/misc/rp1/rp1_pci.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/misc/rp1/rp1_pci.c b/drivers/misc/rp1/rp1_pci.c
> index 803832006ec8..a342bcc6164b 100644
> --- a/drivers/misc/rp1/rp1_pci.c
> +++ b/drivers/misc/rp1/rp1_pci.c
> @@ -289,6 +289,9 @@ static int rp1_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> goto err_unload_overlay;
> }
>
> + if (skip_ovl)
> + of_node_put(rp1_node);
> +
> return 0;
>
> err_unload_overlay:
> --
> 2.51.1
>
Reviewed-by: Andrea della Porta <andrea.porta@suse.com>
Thanks!
Andrea
prev parent reply other threads:[~2025-11-10 10:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-08 7:14 [PATCH v3] misc: rp1: Fix an error handling path in rp1_probe() Christophe JAILLET
2025-11-10 11:02 ` 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=aRHGNrth4GEu5J-_@apocalypse \
--to=andrea.porta@suse.com \
--cc=arnd@arndb.de \
--cc=bhelgaas@google.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=florian.fainelli@broadcom.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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.