sparclinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Salah Triki <salah.triki@gmail.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: "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: Wed, 9 Apr 2025 13:51:25 +0100	[thread overview]
Message-ID: <Z_ZtTeaHpJeVH-lN@pc> (raw)
In-Reply-To: <e2a4e693-46db-4b1f-87c2-2867a4cb196d@wanadoo.fr>

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@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)
> 

  reply	other threads:[~2025-04-09 12:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-07 11:06 [PATCH] sparc: pci: Fix memory leak in pci_bus_slot_names() Salah Triki
2025-04-07 19:49 ` Christophe JAILLET
2025-04-09 12:51   ` Salah Triki [this message]
  -- 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=Z_ZtTeaHpJeVH-lN@pc \
    --to=salah.triki@gmail.com \
    --cc=andreas@gaisler.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).