]> 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>
Mon, 8 Sep 2025 21:48:39 +0000 (17:48 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Sep 2025 14:29:55 +0000 (16:29 +0200)
commit69dd5bbdd79c65445bb17c3c53510783bc1d756c
tree7839e773fef40ae75ba9c6d331c5dbb286bb9b15
parent80fc7c7efc4cb841e8476b2936a731ac71beb4c8
media: mediatek: vcodec: Fix a resource leak related to the scp device in FW initialization

[ Upstream commit 4936cd5817af35d23e4d283f48fa59a18ef481e4 ]

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>
[ Adapted file path ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw_scp.c