Linux PCI subsystem development
 help / color / mirror / Atom feed
From: "Krzysztof Wilczyński" <kw@linux.com>
To: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: bhelgaas@google.com, kishon@kernel.org,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	Dan Carpenter <dan.carpenter@linaro.org>
Subject: Re: [PATCH] PCI: Pass domain number explicitly to pci_bus_release_domain_nr() API
Date: Sat, 14 Sep 2024 07:50:11 +0900	[thread overview]
Message-ID: <20240913225011.GC635227@rocinante> (raw)
In-Reply-To: <20240912053025.25314-1-manivannan.sadhasivam@linaro.org>

Hello,

> pci_bus_release_domain_nr() API is supposed to free the domain number
> allocated by pci_bus_find_domain_nr(). Most of the callers of
> pci_bus_find_domain_nr(), store the domain number in pci_bus::domain_nr.
> 
> So pci_bus_release_domain_nr() implicitly frees the domain number by
> dereferencing 'struct pci_bus'. But one of the callers of this API, PCI
> endpoint subsystem doesn't have 'struct pci_bus', so it only passes NULL.
> Due to this, the API will end up dereferencing the NULL pointer.
> 
> To fix this issue, let's just pass the domain number explicitly to this
> API. Since 'struct pci_bus' is not used for any other purposes in this API
> other than extracting the domain number, it makes sense to pass the domain
> number directly.

Applied to controller/qcom, thank you!

[1/1] PCI: Pass domain number to pci_bus_release_domain_nr() explicitly
      https://git.kernel.org/pci/pci/c/0cca961a0261

	Krzysztof

      reply	other threads:[~2024-09-13 22:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-12  5:30 [PATCH] PCI: Pass domain number explicitly to pci_bus_release_domain_nr() API Manivannan Sadhasivam
2024-09-13 22:50 ` Krzysztof Wilczyński [this message]

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=20240913225011.GC635227@rocinante \
    --to=kw@linux.com \
    --cc=bhelgaas@google.com \
    --cc=dan.carpenter@linaro.org \
    --cc=kishon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.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