From 064c930b65441e317a10d2022bc3b3183141e75e Mon Sep 17 00:00:00 2001 From: Haoxiang Li Date: Tue, 2 Jun 2026 15:19:27 +0800 Subject: [PATCH] mvs: free DMA slots on channel attach failure 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 --- sys/dev/mvs/mvs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/mvs/mvs.c b/sys/dev/mvs/mvs.c index aafe68d04685a3..f2cccf614a3e17 100644 --- a/sys/dev/mvs/mvs.c +++ b/sys/dev/mvs/mvs.c @@ -209,6 +209,7 @@ mvs_ch_attach(device_t dev) err0: bus_release_resource(dev, SYS_RES_MEMORY, ch->unit, ch->r_mem); mtx_unlock(&ch->mtx); + mvs_slotsfree(dev); mtx_destroy(&ch->mtx); return (error); }