]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: mediatek: vcodec: Fix a resource leak related to the scp device in FW initiali...
authorJiasheng Jiang <jiashengjiangcool@gmail.com>
Tue, 18 Feb 2025 18:58:09 +0000 (18:58 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Apr 2025 08:45:21 +0000 (10:45 +0200)
commitfd7bb97ede487b9f075707b7408a9073e0d474b1
tree6a4bf9ae3cb5aacd9ca8fe1463074263257b0170
parent39cb5a29cd60866616b9378beac329ce6cc91f7a
media: mediatek: vcodec: Fix a resource leak related to the scp device in FW initialization

commit 4936cd5817af35d23e4d283f48fa59a18ef481e4 upstream.

On Mediatek devices with a system companion processor (SCP) the mtk_scp
structure has to be removed explicitly to avoid a resource leak.
Free the structure in case the allocation of the firmware structure fails
during the firmware initialization.

Fixes: 53dbe0850444 ("media: mtk-vcodec: potential null pointer deference in SCP")
Cc: stable@vger.kernel.org
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_scp.c