mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
usb: cdnsp: fix stream context array leak in cdnsp_alloc_stream_info()
commit3348f444a4upstream. cdnsp_alloc_stream_info() allocates stream_info->stream_ctx_array with cdnsp_alloc_stream_ctx(). If a later stream ring allocation or stream mapping update fails, the error path frees the allocated stream rings and stream_rings array, but leaves stream_ctx_array allocated. Free the stream context array before falling through to the stream_rings cleanup path. Fixes:3d82904559("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver") Cc: stable <stable@kernel.org> Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com> Acked-by: Peter Chen <peter.chen@kernel.org> Link: https://patch.msgid.link/20260622052627.696373-1-haoxiang_li2024@163.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
19d9ff2b42
commit
fde3c095e1
@@ -632,6 +632,8 @@ cleanup_rings:
|
||||
}
|
||||
}
|
||||
|
||||
cdnsp_free_stream_ctx(pdev, pep);
|
||||
|
||||
cleanup_stream_rings:
|
||||
kfree(pep->stream_info.stream_rings);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user