Skip to content

Commit b40ec65

Browse files
Haoxiang Ligregkh
authored andcommitted
media: chips-media: wave5: fix a potential memory leak in wave5_vdi_init()
commit 95bd174 upstream. Add wave5_vdi_free_dma_memory() in the error path of wave5_vdi_init() to prevent a potential memory leak. Fixes: 45d1a2b ("media: chips-media: wave5: Add vpuapi layer") Cc: stable@vger.kernel.org Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6261d5f commit b40ec65

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/media/platform/chips-media/wave5/wave5-vdi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ int wave5_vdi_init(struct device *dev)
4949

5050
if (!PRODUCT_CODE_W_SERIES(vpu_dev->product_code)) {
5151
WARN_ONCE(1, "unsupported product code: 0x%x\n", vpu_dev->product_code);
52+
wave5_vdi_free_dma_memory(vpu_dev, &vpu_dev->common_mem);
5253
return -EOPNOTSUPP;
5354
}
5455

0 commit comments

Comments
 (0)