]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
media: cedrus: clean up media device on probe failure
authorMyeonghun Pak <mhun512@gmail.com>
Wed, 6 May 2026 12:41:16 +0000 (21:41 +0900)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Thu, 21 May 2026 10:32:21 +0000 (12:32 +0200)
commit2c869b6969f3061cbbdab587f4c0a88bd7fc3cc9
treee4262cd1d62c68594ac0673db27844e533f7c384
parent24a63d4c9d3ce3afc99f698cff62d79c457fc5ca
media: cedrus: clean up media device on probe failure

cedrus_probe() initializes the media device before registering the video
device, the media controller, and the media device. If any of those later
steps fails, probe returns without calling media_device_cleanup(), so the
media device internals initialized by media_device_init() are left behind.

Add a media-device cleanup label to the probe unwind path and route video
registration failures through it as well.

Fixes: 50e761516f2b8c ("media: platform: Add Cedrus VPU decoder driver")
Cc: stable@vger.kernel.org
Reviewed-by: Paul Kocialkowski <paulk@sys-base.io>
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/staging/media/sunxi/cedrus/cedrus.c