]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: davinci: vpif: Fix memory leak in probe error path
authorDmitry Nikiforov <Dm1tryNk@yandex.ru>
Wed, 16 Apr 2025 20:51:19 +0000 (23:51 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:11:17 +0000 (11:11 +0100)
commitca43a9386c0b5e737c99d3cfbc647e0ccd7d0c79
tree87b328ab98b04d2b4a2277e165b4a172f2b17aae
parent9bff888c92f5c25effbb876d22a793c2388c1ccc
media: davinci: vpif: Fix memory leak in probe error path

commit 024bf40edf1155e7a587f0ec46294049777d9b02 upstream.

If an error occurs during the initialization of `pdev_display`,
the allocated platform device `pdev_capture` is not released properly,
leading to a memory leak.

Adjust error path handling to fix the leak.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 43acb728bbc4 ("media: davinci: vpif: fix use-after-free on driver unbind")
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Nikiforov <Dm1tryNk@yandex.ru>
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/ti/davinci/vpif.c