summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorFan Wu <fanwu01@zju.edu.cn>2026-07-18 02:43:52 +0000
committerJohannes Berg <johannes.berg@intel.com>2026-07-21 13:35:29 +0200
commit538c51e9d124cf656f2dd0c0394a8545efc7102d (patch)
tree4519ecc8ebf6e266d124c65e5d93881b1886d89a /include/linux
parenta007a384c9eb17610f53a53e2f59944c31f1565a (diff)
wifi: brcmfmac: make release_scratchbuffers idempotent
brcmf_pcie_release_scratchbuffers() frees the shared.scratch and shared.ringupd DMA buffers with dma_free_coherent() but does not clear the pointers afterwards, unlike the sibling release_ringbuffers() which NULLs commonrings/flowrings/idxbuf on release. Both the bus_reset .reset callback (brcmf_pcie_reset) and brcmf_pcie_remove() call release_scratchbuffers. When reset teardown has run before removal, remove's own teardown would call dma_free_coherent() a second time on the already-freed DMA allocation. NULL the pointers after free, matching release_ringbuffers(), so a later release observes that the allocation has already been released. This patch makes repeated sequential release safe; the reset-work lifetime is handled separately by the following patch. This issue was found by an in-house static analysis tool. Fixes: 4684997d9eea ("brcmfmac: reset PCIe bus on a firmware crash") Cc: stable@vger.kernel.org Signed-off-by: Fan Wu <fanwu01@zju.edu.cn> Assisted-by: Codex:gpt-5.6 Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com> Link: https://patch.msgid.link/20260718024353.3147201-2-fanwu01@zju.edu.cn Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions