mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: chalianis1@gmail.com, s.hauer@pengutronix.de
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] pci: pci-tegra: fix null pointer assignation.
Date: Thu, 27 Nov 2025 10:19:34 +0100	[thread overview]
Message-ID: <7391cf043e0c56d2b52fe7fdd278349229516f45.camel@pengutronix.de> (raw)
In-Reply-To: <20251127034024.3381739-1-chalianis1@gmail.com>

Hi,

Am Mittwoch, dem 26.11.2025 um 22:40 -0500 schrieb
chalianis1@gmail.com:
> From: Chali Anis <chalianis1@gmail.com>
> 
> the dev might be null, to be sure we move the dev assignation before
> the pci parent assignation.

This isn't worded strongly enough. pcie->dev will absolutely be NULL at
the point where it is assigned to pci.parent, which seem like a blatant
bug and I don't know how this did ever work or if we just ignored the
broken parent device connection.

Other than the commit message needing some adjustment, this change
looks correct.

Regards,
Lucas

> 
> Signed-off-by: Chali Anis <chalianis1@gmail.com>
> ---
>  drivers/pci/pci-tegra.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/pci-tegra.c b/drivers/pci/pci-tegra.c
> index b7f8297d153e..dabe63500a4a 100644
> --- a/drivers/pci/pci-tegra.c
> +++ b/drivers/pci/pci-tegra.c
> @@ -1240,13 +1240,13 @@ static int tegra_pcie_probe(struct device *dev)
>  	if (!pcie)
>  		return -ENOMEM;
>  
> +	pcie->dev = dev;
>  	pcie->pci.parent = pcie->dev;
>  	pci_controller_init(&pcie->pci);
>  
>  	INIT_LIST_HEAD(&pcie->buses);
>  	INIT_LIST_HEAD(&pcie->ports);
>  	pcie->soc_data = device_get_match_data(dev);
> -	pcie->dev = dev;
>  
>  	err = tegra_pcie_parse_dt(pcie);
>  	if (err < 0) {
> 




  reply	other threads:[~2025-11-27  9:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-27  3:40 chalianis1
2025-11-27  9:19 ` Lucas Stach [this message]
2025-11-27 11:53   ` Sascha Hauer
2025-11-27 11:54   ` Sascha Hauer
2025-11-27 11:53 ` Sascha Hauer

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=7391cf043e0c56d2b52fe7fdd278349229516f45.camel@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=chalianis1@gmail.com \
    --cc=s.hauer@pengutronix.de \
    /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