]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
media: media/saa7164: fix saa7164_encoder_register() memory leak bugs
authorDaniel Niv <danielniv3@gmail.com>
Thu, 11 Mar 2021 02:53:00 +0000 (03:53 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 19 May 2021 08:59:40 +0000 (10:59 +0200)
commit53be7c85f12933d13563c8527d9b87c5ee9efc6d
treebd9a049762895cfe672201b8086ac079a95aaaa0
parentb79de20b36403c14cd52e4bb356beeb359f15bf2
media: media/saa7164: fix saa7164_encoder_register() memory leak bugs

BugLink: https://bugs.launchpad.net/bugs/1928825
[ Upstream commit c759b2970c561e3b56aa030deb13db104262adfe ]

Add a fix for the memory leak bugs that can occur when the
saa7164_encoder_register() function fails.
The function allocates memory without explicitly freeing
it when errors occur.
Add a better error handling that deallocate the unused buffers before the
function exits during a fail.

Signed-off-by: Daniel Niv <danielniv3@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/media/pci/saa7164/saa7164-encoder.c