From: Nicolas Dufresne <nicolas@ndufresne.ca>
To: 박명훈 <mhun512@gmail.com>, "Maxime Ripard" <mripard@kernel.org>,
"Paul Kocialkowski" <paulk@sys-base.io>,
"Mauro Carvalho Chehab" <mchehab@kernel.org>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Chen-Yu Tsai" <wens@kernel.org>,
"Jernej Skrabec" <jernej.skrabec@gmail.com>,
"Samuel Holland" <samuel@sholland.org>
Cc: linux-media@vger.kernel.org, linux-staging@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, Ijae Kim <ae878000@gmail.com>
Subject: Re: [PATCH] media: cedrus: clean up media device on probe failure
Date: Wed, 29 Apr 2026 15:08:02 -0400 [thread overview]
Message-ID: <6b9544538177a833c7de635782c67f3fae0beef5.camel@ndufresne.ca> (raw)
In-Reply-To: <20260427100049.29034-1-pakmyeonghun@bagmyeonghun-ui-MacBookPro.local>
[-- Attachment #1: Type: text/plain, Size: 1892 bytes --]
Le lundi 27 avril 2026 à 19:00 +0900, 박명훈 a écrit :
> From: Myeonghun Pak <mhun512@gmail.com>
>
> 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
> Co-developed-by: Ijae Kim <ae878000@gmail.com>
> Signed-off-by: Ijae Kim <ae878000@gmail.com>
> Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
> ---
> drivers/staging/media/sunxi/cedrus/cedrus.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c
> index 6600245dff..2c25654640 100644
> --- a/drivers/staging/media/sunxi/cedrus/cedrus.c
> +++ b/drivers/staging/media/sunxi/cedrus/cedrus.c
> @@ -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_cleanup;
> }
>
> v4l2_info(&dev->v4l2_dev,
> @@ -533,6 +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_media_cleanup:
> + media_device_cleanup(&dev->mdev);
> err_m2m:
This label is left unused. Can you fix this warning please.
Nicolas
> v4l2_m2m_release(dev->m2m_dev);
> err_v4l2:
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2026-04-29 19:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 10:00 [PATCH] media: cedrus: clean up media device on probe failure 박명훈
2026-04-29 19:08 ` Nicolas Dufresne [this message]
2026-04-30 3:42 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6b9544538177a833c7de635782c67f3fae0beef5.camel@ndufresne.ca \
--to=nicolas@ndufresne.ca \
--cc=ae878000@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jernej.skrabec@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=linux-sunxi@lists.linux.dev \
--cc=mchehab@kernel.org \
--cc=mhun512@gmail.com \
--cc=mripard@kernel.org \
--cc=paulk@sys-base.io \
--cc=samuel@sholland.org \
--cc=stable@vger.kernel.org \
--cc=wens@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox