Loading
media: platform: allegro-dvt: Fix possible memory leak in allocate_buffers_internal()
mainline inclusion from mainline-v6.13-rc1 commit 0f514068fbc5d4d189c817adc7c4e32cffdc2e47 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBEAMP CVE: CVE-2024-56572 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0f514068fbc5d4d189c817adc7c4e32cffdc2e47 -------------------------------- 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: f20387df ("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> Conflicts: drivers/media/platform/allegro-dvt/allegro-core.c drivers/staging/media/allegro-dvt/allegro-core.c [Context conflicts] Signed-off-by:
Qi Xi <xiqi2@huawei.com>