Re: [PATCH v2 2/2] PCI: of_property: Omit 'bus-range' property if no secondary bus

From: Bo Sun
Date: Thu Mar 20 2025 - 21:17:48 EST


On 3/18/25 14:29, Manivannan Sadhasivam wrote:
CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

On Tue, Mar 11, 2025 at 09:52:29PM +0800, Bo Sun wrote:
The previous implementation of of_pci_add_properties() and
of_pci_prop_bus_range() assumed that a valid secondary bus is always
present, which can be problematic in cases where no bus numbers are
assigned for a secondary bus. This patch introduces a check for a valid
secondary bus and omits the 'bus-range' property if it is not available,
preventing dereferencing the NULL pointer.


This definitely needs a Fixes tag and should be backported.

OK, I will add the Fixes tag and send the v3 patches.

Thanks,
Bo