]> git.ipfire.org Git - thirdparty/kernel/stable.git/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:50:33 +0000 (19:50 +0100)
commit64f72a738864b506ab50b4a6cb3ce3c3e04b71af
treeeaabda66000015e5768b10bf03444073ac9bb546
parent944303ecc9b50a21773c94b63bf44e10fad5f75a
media: platform: allegro-dvt: Fix possible memory leak in allocate_buffers_internal()

commit 0f514068fbc5d4d189c817adc7c4e32cffdc2e47 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/allegro-dvt/allegro-core.c