Skip to content

dmaengine: dma-jz4780: fix NULL dereference in tx_status - #18

Open
wormuz wants to merge 1 commit into
OpenDingux:jz-6.13from
wormuz:fix/jz4780-dma-tx-status-null
Open

dmaengine: dma-jz4780: fix NULL dereference in tx_status#18
wormuz wants to merge 1 commit into
OpenDingux:jz-6.13from
wormuz:fix/jz4780-dma-tx-status-null

Conversation

@wormuz

@wormuz wormuz commented Aug 15, 2026

Copy link
Copy Markdown

jz4780_dma_tx_status() dereferences jzchan->desc->vdesc.tx.cookie without checking jzchan->desc. A status query racing the completion handler (which clears jzchan->desc) faults.

Reproduced on an RG350P handheld (JZ4770) via the MMC path querying residue after a completed transfer.

jz4780_dma_tx_status() dereferences jzchan->desc->vdesc.tx.cookie
without checking jzchan->desc. When the status of a completed
transfer is queried after the channel finished (or was terminated)
and no descriptor is active, jzchan->desc is NULL and the comparison
faults.

Reproduced on JZ4770 (RG350P handheld): querying residue from the
MMC path after a completed transfer races the completion handler
clearing jzchan->desc.

Check jzchan->desc before comparing the cookie; with no active
descriptor the residue lookup falls through to the default (0),
which is correct for a completed transfer.

Signed-off-by: wormuz <3341798+wormuz@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant