From: "Thakkar, Devarsh" <devarsht@ti.com>
To: "Brnich, Brandon" <b-brnich@ti.com>,
"mchehab@kernel.org" <mchehab@kernel.org>,
"hverkuil@kernel.org" <hverkuil@kernel.org>,
"nicolas.dufresne@collabora.com" <nicolas.dufresne@collabora.com>,
"benjamin.gaignard@collabora.com"
<benjamin.gaignard@collabora.com>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Myeonghun Pak <mhun512@gmail.com>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH v6 1/4] media: imagination: e5010: release m2m device on probe failure
Date: Fri, 6 Nov 2026 07:27:57 +0000 [thread overview]
Message-ID: <78a1f748-6ab3-40dc-8eb6-6a655e8e670f@ti.com> (raw)
In-Reply-To: <20261023144618.1652390-2-b-brnich@ti.com>
On 23/10/26 20:16, Brnich, Brandon wrote:
> From: Myeonghun Pak <mhun512@gmail.com>
>
> The probe path allocates the mem2mem device with v4l2_m2m_init(),
> but several later failures jump directly to the v4l2_device_unregister()
> unwind path. Since the driver core does not call .remove() after a failed
> probe, those paths leak the m2m device.
>
> Route post-v4l2_m2m_init() failures through the existing m2m release step
> before unregistering the v4l2 device.
>
> Fixes: a1e294045885 ("media: imagination: Add E5010 JPEG Encoder driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
> Signed-off-by: Brandon Brnich <b-brnich@ti.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
Regards
Devarsh
> ---
> drivers/media/platform/imagination/e5010-jpeg-enc.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/media/platform/imagination/e5010-jpeg-enc.c b/drivers/media/platform/imagination/e5010-jpeg-enc.c
> index 420cb8bfdb12a..23d06709a6929 100644
> --- a/drivers/media/platform/imagination/e5010-jpeg-enc.c
> +++ b/drivers/media/platform/imagination/e5010-jpeg-enc.c
> @@ -1072,14 +1072,14 @@ static int e5010_probe(struct platform_device *pdev)
> if (IS_ERR(e5010->core_base)) {
> ret = PTR_ERR(e5010->core_base);
> dev_err_probe(dev, ret, "Missing 'core' resources area\n");
> - goto fail_after_v4l2_register;
> + goto fail_after_v4l2_m2m_init;
> }
>
> e5010->mmu_base = devm_platform_ioremap_resource_byname(pdev, "mmu");
> if (IS_ERR(e5010->mmu_base)) {
> ret = PTR_ERR(e5010->mmu_base);
> dev_err_probe(dev, ret, "Missing 'mmu' resources area\n");
> - goto fail_after_v4l2_register;
> + goto fail_after_v4l2_m2m_init;
> }
>
> e5010->last_context_run = NULL;
> @@ -1089,14 +1089,14 @@ static int e5010_probe(struct platform_device *pdev)
> E5010_MODULE_NAME, e5010);
> if (ret) {
> dev_err_probe(dev, ret, "failed to register IRQ %d\n", irq);
> - goto fail_after_v4l2_register;
> + goto fail_after_v4l2_m2m_init;
> }
>
> e5010->clk = devm_clk_get(dev, NULL);
> if (IS_ERR(e5010->clk)) {
> ret = PTR_ERR(e5010->clk);
> dev_err_probe(dev, ret, "failed to get clock\n");
> - goto fail_after_v4l2_register;
> + goto fail_after_v4l2_m2m_init;
> }
>
> pm_runtime_enable(dev);
> @@ -1104,7 +1104,7 @@ static int e5010_probe(struct platform_device *pdev)
> ret = video_register_device(e5010->vdev, VFL_TYPE_VIDEO, 0);
> if (ret) {
> dev_err_probe(dev, ret, "failed to register video device\n");
> - goto fail_after_video_register_device;
> + goto fail_after_v4l2_m2m_init;
> }
>
> v4l2_info(&e5010->v4l2_dev, "Device registered as /dev/video%d\n",
> @@ -1112,7 +1112,7 @@ static int e5010_probe(struct platform_device *pdev)
>
> return 0;
>
> -fail_after_video_register_device:
> +fail_after_v4l2_m2m_init:
> v4l2_m2m_release(e5010->m2m_dev);
> fail_after_v4l2_register:
> v4l2_device_unregister(&e5010->v4l2_dev);
next prev parent reply other threads:[~2026-11-06 7:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-23 14:46 [PATCH v6 0/4] E5010 Probe Cleanup and Adding autosuspend b-brnich
2026-10-23 14:46 ` [PATCH v6 1/4] media: imagination: e5010: release m2m device on probe failure b-brnich
2026-11-06 7:27 ` Thakkar, Devarsh [this message]
2026-10-23 14:46 ` [PATCH v6 2/4] media: imagination: e5010: Fix clk never enabled without CONFIG_PM b-brnich
2026-11-06 14:57 ` Thakkar, Devarsh
2026-10-23 14:46 ` [PATCH v6 3/4] media: imagination: e5010: Move e5010_init_device to Runtime Resume Hook b-brnich
2026-10-23 14:46 ` [PATCH v6 4/4] media: imagination: e5010: Enable autosuspend for runtime PM b-brnich
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=78a1f748-6ab3-40dc-8eb6-6a655e8e670f@ti.com \
--to=devarsht@ti.com \
--cc=b-brnich@ti.com \
--cc=benjamin.gaignard@collabora.com \
--cc=hverkuil@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=mhun512@gmail.com \
--cc=nicolas.dufresne@collabora.com \
--cc=stable@vger.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
all inboxes | Powered by JetHome®