Re: [PATCH net] net: alacritech: fix dma_free_coherent() in error path

From: Daniel Machon

Date: Sat Oct 10 2026 - 11:33:43 EST


> In slic_init_stat_queue(), a series of coherent buffers is allocated
> with the length size. The size is then stored in stq->mem_size for
> normal deallocation. However, in the error path, stq->mem_size is also
> used but is not initialized. This error may leave the freed buffers
> mapped, leaking a resource and allowing the device to access freed
> memory.
>
> Change the length in error path to size.
>

Reviewed-by: Daniel Machon <daniel.machon@xxxxxxxxxxxxx>