Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] PCI: dwc: Guard RAS DES debugfs deinit
@ 2026-05-18 16:59 Shuvam Pandey
  2026-05-18 16:59 ` [PATCH 2/2] PCI: meson: Add missing remove callback Shuvam Pandey
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Shuvam Pandey @ 2026-05-18 16:59 UTC (permalink / raw)
  To: Jingoo Han, Manivannan Sadhasivam, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Bjorn Helgaas, Yue Wang,
	Neil Armstrong
  Cc: Rob Herring, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
	Fan Ni, Shradha Todi, Hanjie Lin, linux-pci, linux-amlogic,
	linux-arm-kernel, linux-kernel

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>
---
 drivers/pci/controller/dwc/pcie-designware-debugfs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/pci/controller/dwc/pcie-designware-debugfs.c b/drivers/pci/controller/dwc/pcie-designware-debugfs.c
index d0884253b..c3671cb2f 100644
--- a/drivers/pci/controller/dwc/pcie-designware-debugfs.c
+++ b/drivers/pci/controller/dwc/pcie-designware-debugfs.c
@@ -557,6 +557,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);
 }
 
-- 
2.50.1 (Apple Git-155)



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-06-11 22:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-18 16:59 [PATCH 1/2] PCI: dwc: Guard RAS DES debugfs deinit Shuvam Pandey
2026-05-18 16:59 ` [PATCH 2/2] PCI: meson: Add missing remove callback Shuvam Pandey
2026-06-09 16:41   ` (subset) " Manivannan Sadhasivam
2026-06-11 22:26   ` Bjorn Helgaas
2026-06-09 16:44 ` (subset) [PATCH 1/2] PCI: dwc: Guard RAS DES debugfs deinit Manivannan Sadhasivam
2026-06-11 22:10 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox