Skip to contentSkip to conversation

media: cedrus: clean up media device on probe failure

PATCH In review Myeonghun Pak 1 participant 2 messages May 6 – May 10 1 message not in the archive

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 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")

---
Changes in v3:
- Rename the media cleanup label to err_media.
- Add Paul's Reviewed-by tag.

Changes in v2:
- Drop the now-unused err_m2m label.

 drivers/staging/media/sunxi/cedrus/cedrus.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/staging/media/sunxi/cedrus/cedrus.c +3 -2
index 6600245dff..7cb1f110d6 100644
@@ -507,7 +507,7 @@ static int cedrus_probe(struct platform_device *pdev)
 	ret = video_register_device(vfd, VFL_TYPE_VIDEO, 0);
 	if (ret) {
 		v4l2_err(&dev->v4l2_dev, "Failed to register video device\n");
-		goto err_m2m;
+		goto err_media;
 	}
 
 	v4l2_info(&dev->v4l2_dev,
@@ -533,7 +533,8 @@ static int cedrus_probe(struct platform_device *pdev)
 	v4l2_m2m_unregister_media_controller(dev->m2m_dev);
 err_video:
 	video_unregister_device(&dev->vfd);
-err_m2m:
+err_media:
+	media_device_cleanup(&dev->mdev);
 	v4l2_m2m_release(dev->m2m_dev);
 err_v4l2:
 	v4l2_device_unregister(&dev->v4l2_dev);
Signature · 1 line
2.47.1

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Hi,

I did not add Ricardo's Signed-off-by because this patch was submitted directly by me and has not been handled by Ricardo.

This looks like a Media CI false positive. Could you please confirm whether this report can be ignored?

Thanks,
Myeonghun

2026년 5월 7일 (목) 오전 1:20, Patchwork Integration <[email protected]>님이 작성:

Quoted 30 lines

Dear Myeonghun Pak:

Thanks for your patches! Unfortunately the Media CI robot detected some issues:

# Test media-patchstyle:./0001-media-cedrus-clean-up-media-device-on-probe-failure.patch media style
ERROR: ./0001-media-cedrus-clean-up-media-device-on-probe-failure.patch: Missing committer Ricardo Ribalda <[email protected]> Signed-off-by

Please fix your series, and upload a new version. If you have a patchwork account, do not forget to mark the current series as Superseded.

For more details, check the full report at:
https://linux-media.pages.freedesktop.org/-/users/patchwork/-/jobs/99164268/artifacts/report.htm .

Best regards, and Happy Hacking!
Media CI robot on behalf of the linux-media community.

---
Check the latest rules for contributing your patches at:
https://docs.kernel.org/driver-api/media/maintainer-entry-profile.html

If you believe that the CI is wrong, kindly open an issue at
https://gitlab.freedesktop.org/linux-media/media-ci/-/issues or reply-all to this message.