[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e2a4e693-46db-4b1f-87c2-2867a4cb196d@wanadoo.fr>
Date: Mon, 7 Apr 2025 21:49:08 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Salah Triki <salah.triki@...il.com>, "David S. Miller"
<davem@...emloft.net>, Andreas Larsson <andreas@...sler.com>,
sparclinux@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sparc: pci: Fix memory leak in pci_bus_slot_names()
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@...il.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)
Powered by blists - more mailing lists