]> git.hungrycats.org Git - linux/commit
media: platform: allegro-dvt: Fix possible memory leak in allocate_buffers_internal()
authorGaosheng Cui <cuigaosheng1@huawei.com>
Wed, 9 Oct 2024 08:28:02 +0000 (16:28 +0800)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Sat, 12 Oct 2024 14:28:26 +0000 (16:28 +0200)
commit0f514068fbc5d4d189c817adc7c4e32cffdc2e47
treeb3cfdb8cddee71f2c39fcc06024e3dbf4801a926
parent869f38ae07f7df829da4951c3d1f7a2be09c2e9a
media: platform: allegro-dvt: Fix possible memory leak in allocate_buffers_internal()

The buffer in the loop should be released under the exception path,
otherwise there may be a memory leak here.

To mitigate this, free the buffer when allegro_alloc_buffer fails.

Fixes: f20387dfd065 ("media: allegro: add Allegro DVT video IP core driver")
Cc: <stable@vger.kernel.org>
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/platform/allegro-dvt/allegro-core.c