[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z_ZtTeaHpJeVH-lN@pc>
Date: Wed, 9 Apr 2025 13:51:25 +0100
From: Salah Triki <salah.triki@...il.com>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: "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()
On Mon, Apr 07, 2025 at 09:49:08PM +0200, Christophe JAILLET wrote:
> 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
Hi,
Sorry for disturbing, I was wrong about that.
ST
>
> >
> > 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