2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-10 06:34:17 +08:00
linux-next/drivers/media/platform/mediatek
Dan Carpenter cf10b0bb50 media: mediatek: vcodec: fix resource leaks in vdec_msg_queue_init()
If we encounter any error in the vdec_msg_queue_init() then we need
to set "msg_queue->wdma_addr.size = 0;".  Normally, this is done
inside the vdec_msg_queue_deinit() function.  However, if the
first call to allocate &msg_queue->wdma_addr fails, then the
vdec_msg_queue_deinit() function is a no-op.  For that situation, just
set the size to zero explicitly and return.

There were two other error paths which did not clean up before returning.
Change those error paths to goto mem_alloc_err.

Fixes: b199fe46f3 ("media: mtk-vcodec: Add msg queue feature for lat and core architecture")
Fixes: 2f5d0aef37 ("media: mediatek: vcodec: support stateless AV1 decoder")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2023-07-25 10:35:00 +02:00
..
jpeg media: mtk-jpeg: Fix use after free bug due to uncanceled work 2023-07-25 09:31:48 +02:00
mdp media: Explicitly include correct DT includes 2023-07-19 12:57:51 +02:00
mdp3 media: mdp3: Fix resource leaks in of_find_device_by_node 2023-07-19 12:57:47 +02:00
vcodec media: mediatek: vcodec: fix resource leaks in vdec_msg_queue_init() 2023-07-25 10:35:00 +02:00
vpu media: Explicitly include correct DT includes 2023-07-19 12:57:51 +02:00
Kconfig media: platform: mtk-mdp3: add MediaTek MDP3 driver 2022-08-30 16:25:51 +02:00
Makefile media: platform: mtk-mdp3: add MediaTek MDP3 driver 2022-08-30 16:25:51 +02:00