]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: platform: mtk-mdp3: fix device leaks at probe
authorJohan Hovold <johan@kernel.org>
Wed, 24 Sep 2025 14:39:19 +0000 (16:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2026 09:17:04 +0000 (10:17 +0100)
commit31ba1a4d7a5d9466f6ef4910a372b8200f8aad19
tree9e5df3d1b8393df2d8bf476a5b624c937756dc0f
parenta003505a5c8c758ccd1beb48e8238ace7e14707b
media: platform: mtk-mdp3: fix device leaks at probe

commit 8f6f3aa21517ef34d50808af0c572e69580dca20 upstream.

Make sure to drop the references taken when looking up the subsys
devices during probe on probe failure (e.g. probe deferral) and on
driver unbind.

Similarly, drop the SCP device reference after retrieving its platform
data during probe to avoid leaking it.

Note that holding a reference to a device does not prevent its driver
data from going away.

Fixes: 61890ccaefaf ("media: platform: mtk-mdp3: add MediaTek MDP3 driver")
Cc: stable@vger.kernel.org # 6.1
Cc: Moudy Ho <moudy.ho@mediatek.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c