Re: [PATCH 2/5] PCI: cadence: Fix NULL pointer error for ops

Chen Wang <[email protected]>
Newsgroups dev.linux.lists.sophgo,org.infradead.lists.linux-riscv,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci
Message-ID <MAUPR01MB11072761AFC08D7F9A1EAEC08FE3AA@MAUPR01MB11072.INDPRD01.PROD.OUTLOOK.COM>
On 8/29/2025 5:43 AM, Bjorn Helgaas wrote:
> On Thu, Aug 28, 2025 at 10:17:17AM +0800, Chen Wang wrote:
>> From: Chen Wang <[email protected]>
>>
>> ops of struct cdns_pcie may be NULL, direct use
>> will result in a null pointer error.
>>
>> Add checking of pcie->ops before using it.
>>
>> Fixes: 40d957e6f9eb ("PCI: cadence: Add support to start link and verify link status")
> Do you observe this NULL pointer dereference with an existing driver?
>
> If this is only to make it possible to add a new driver that doesn't
> supply a pcie->ops pointer, it doesn't need a Fixes: tag because
> there's not a problem with existing drivers and this change would not
> need to be backported.
>
> If it *is* a problem with an existing driver, please point out which
> one.

No, the existing driver does not have this problem. Only my newly added 
driver doesn't supply a pcie->ops pointer.

I will remove this Fixes tag in next revision.

Thanks,

Chen

[......]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.