From: Shuvam Pandey <shuvampandey1@gmail.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: "Jingoo Han" <jingoohan1@gmail.com>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Yue Wang" <yue.wang@amlogic.com>,
"Neil Armstrong" <neil.armstrong@linaro.org>,
"Rob Herring" <robh@kernel.org>,
"Kevin Hilman" <khilman@baylibre.com>,
"Jerome Brunet" <jbrunet@baylibre.com>,
"Martin Blumenstingl" <martin.blumenstingl@googlemail.com>,
"Fan Ni" <fan.ni@samsung.com>,
"Shradha Todi" <shradha.t@samsung.com>,
"Hanjie Lin" <hanjie.lin@amlogic.com>,
linux-pci@vger.kernel.org, linux-amlogic@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] PCI: dwc: Guard RAS DES debugfs deinit
Date: Fri, 12 Jun 2026 20:38:41 +0545 [thread overview]
Message-ID: <CANAAWHKBFmgQfqUNaiUrPxBk4bPoBpRbhJs9YqszKvBUbUrMXg@mail.gmail.com> (raw)
In-Reply-To: <20260611221000.GA524832@bhelgaas>
Hi Bjorn,
> I guess this prevents a NULL pointer dereference, right?
Yes. This is in the CONFIG_PCIE_DW_DEBUGFS teardown path when the
controller does not advertise the RAS DES capability.
In that case dwc_pcie_rasdes_debugfs_init() returns 0 before allocating
pci->debugfs->rasdes_info or initializing reg_event_lock. Later,
dwc_pcie_debugfs_deinit() still calls dwc_pcie_rasdes_debugfs_deinit()
unconditionally.
With CONFIG_DEBUG_MUTEXES, mutex_destroy() dereferences the mutex, so
calling it via &rinfo->reg_event_lock when rinfo is NULL would
dereference NULL. Without CONFIG_DEBUG_MUTEXES, mutex_destroy() is a
no-op, but there is still no RAS DES state to tear down.
So the patch makes the deinit path match the init path: if no
rasdes_info was allocated, skip the RAS DES mutex teardown.
Thanks,
Shuvam
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
prev parent reply other threads:[~2026-06-12 14:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-18 16:59 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-12 14:39 ` Shuvam Pandey
2026-10-02 23: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
2026-06-12 14:53 ` Shuvam Pandey [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=CANAAWHKBFmgQfqUNaiUrPxBk4bPoBpRbhJs9YqszKvBUbUrMXg@mail.gmail.com \
--to=shuvampandey1@gmail.com \
--cc=bhelgaas@google.com \
--cc=fan.ni@samsung.com \
--cc=hanjie.lin@amlogic.com \
--cc=helgaas@kernel.org \
--cc=jbrunet@baylibre.com \
--cc=jingoohan1@gmail.com \
--cc=khilman@baylibre.com \
--cc=kwilczynski@kernel.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=neil.armstrong@linaro.org \
--cc=robh@kernel.org \
--cc=shradha.t@samsung.com \
--cc=yue.wang@amlogic.com \
/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
all inboxes | Powered by JetHome®