diff options
| author | Shuvam Pandey <shuvampandey1@gmail.com> | 2026-05-18 22:44:17 +0545 |
|---|---|---|
| committer | Bjorn Helgaas <bhelgaas@google.com> | 2026-06-11 17:05:08 -0500 |
| commit | 26b67fa10ef84ea667942491b50e6261a45f098d (patch) | |
| tree | e42b76b7e070bdca0cdaaa289af5db914ac59d23 /drivers | |
| parent | 94ac934d2c054fba4a22d8dc84749094c5fa0ec0 (diff) | |
| download | lwn-26b67fa10ef84ea667942491b50e6261a45f098d.tar.gz lwn-26b67fa10ef84ea667942491b50e6261a45f098d.zip | |
PCI: dwc: Avoid dwc_pcie_rasdes_debugfs_deinit() NULL dereference when no RAS DES capability
dwc_pcie_rasdes_debugfs_init() returns success when the controller has no
RAS DES capability, leaving pci->debugfs->rasdes_info unset. The common
debugfs teardown path still calls dwc_pcie_rasdes_debugfs_deinit(), which
dereferences rasdes_info unconditionally.
Return early when no RAS DES state was allocated. In that case no RAS DES
mutex was initialized, so there is nothing to destroy.
Fixes: 4fbfa17f9a07 ("PCI: dwc: Add debugfs based Silicon Debug support for DWC")
Signed-off-by: Shuvam Pandey <shuvampandey1@gmail.com>
[mani: reworded subject]
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/0f97352506d8d813f70f441de4d63fcd5b7d1c3e.1779123847.git.shuvampandey1@gmail.com
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/pci/controller/dwc/pcie-designware-debugfs.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/pci/controller/dwc/pcie-designware-debugfs.c b/drivers/pci/controller/dwc/pcie-designware-debugfs.c index ddbce69b2e9f..c24cbc4677a3 100644 --- a/drivers/pci/controller/dwc/pcie-designware-debugfs.c +++ b/drivers/pci/controller/dwc/pcie-designware-debugfs.c @@ -550,6 +550,9 @@ static void dwc_pcie_rasdes_debugfs_deinit(struct dw_pcie *pci) { struct dwc_pcie_rasdes_info *rinfo = pci->debugfs->rasdes_info; + if (!rinfo) + return; + mutex_destroy(&rinfo->reg_event_lock); } |
