Skip to content

mvs: free DMA slots on channel attach failure#2252

Open
lhx2000 wants to merge 1 commit into
freebsd:mainfrom
lhx2000:slot-free
Open

mvs: free DMA slots on channel attach failure#2252
lhx2000 wants to merge 1 commit into
freebsd:mainfrom
lhx2000:slot-free

Conversation

@lhx2000

@lhx2000 lhx2000 commented Jun 2, 2026

Copy link
Copy Markdown

mvs_ch_attach() allocates per-slot DMA maps with mvs_slotsalloc() before several later attach steps can fail. The detach path frees those maps with mvs_slotsfree(), but attach failure does not reach mvs_ch_detach(), so the maps are leaked on the error path.

Call mvs_slotsfree() before destroying the channel mutex in the common attach failure path.

mvs_ch_attach() allocates per-slot DMA maps with mvs_slotsalloc()
before several later attach steps can fail.  The detach path frees
those maps with mvs_slotsfree(), but attach failure does not reach
mvs_ch_detach(), so the maps are leaked on the error path.

Call mvs_slotsfree() before destroying the channel mutex in the common
attach failure path.

Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
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