From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: Salah Triki <salah.triki@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Andreas Larsson <andreas@gaisler.com>,
sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sparc: pci: Fix memory leak in pci_bus_slot_names()
Date: Mon, 7 Apr 2025 21:49:08 +0200 [thread overview]
Message-ID: <e2a4e693-46db-4b1f-87c2-2867a4cb196d@wanadoo.fr> (raw)
In-Reply-To: <Z_Ox0qp7uuKNUo2U@pc>
Le 07/04/2025 à 13:06, Salah Triki a écrit :
> prop is a local pointer in pci_bus_slot_names(). It is initialized
> by calling of_get_property() so the caller must free prop when done
> using it.
Hi,
can you elaborate why?
It does not look needed to me, and the places using of_get_property()
that I've checked don't have such a kfree().
CJ
>
> Signed-off-by: Salah Triki <salah.triki@gmail.com>
> ---
> arch/sparc/kernel/pci.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
> index ddac216a2aff..fa0da8f45723 100644
> --- a/arch/sparc/kernel/pci.c
> +++ b/arch/sparc/kernel/pci.c
> @@ -971,6 +971,8 @@ static void pci_bus_slot_names(struct device_node *node, struct pci_bus *bus)
> mask &= ~this_bit;
> i++;
> }
> +
> + kfree(prop);
> }
>
> static int __init of_pci_slot_init(void)
next prev parent reply other threads:[~2025-04-07 19:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-07 11:06 Salah Triki
2025-04-07 19:49 ` Christophe JAILLET [this message]
2025-04-09 12:51 ` Salah Triki
-- strict thread matches above, loose matches on Subject: below --
2025-02-20 21:00 Salah Triki
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=e2a4e693-46db-4b1f-87c2-2867a4cb196d@wanadoo.fr \
--to=christophe.jaillet@wanadoo.fr \
--cc=andreas@gaisler.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=salah.triki@gmail.com \
--cc=sparclinux@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 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®