mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Thakkar, Devarsh" <devarsht@ti.com>
To: Wentao Liang <vulab@iscas.ac.cn>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: "linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH] media: imagination: Release m2m device on probe failure
Date: Thu, 5 Nov 2026 14:24:13 +0000	[thread overview]
Message-ID: <d1cce550-6d23-48d7-8ef5-cc5103d52804@ti.com> (raw)
In-Reply-To: <20261103094617.1289402-1-vulab@iscas.ac.cn>

Hi Liang,

Thanks for the patch.

On 03/11/26 15:16, Wentao Liang wrote:
> e5010_probe() initializes the mem2mem device after registering the v4l2
> device. When mapping the "core" or "mmu" register region, requesting the
> IRQ or getting the clock fails, the error path jumps to the
> fail_after_v4l2_register label, which only unregisters the v4l2 device.
> The v4l2_m2m_dev allocated by v4l2_m2m_init() is not released, so it
> leaks on these probe failures.
> 
> Release the m2m device from that label as well, so that every error path
> taken after v4l2_m2m_init() succeeds frees it. v4l2_m2m_release() accepts
> a NULL pointer, so the v4l2_m2m_init() failure path is unaffected.
> 
> Fixes: a1e294045885 ("media: imagination: Add E5010 JPEG Encoder driver")
> Cc: stable@vger.kernel.org
> Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>

This is fixed by already posted patch [0] and series is under review, so
would prefer to take from there.

[0]: https://lore.kernel.org/all/20261023144618.1652390-2-b-brnich@ti.com/

Regards
Devarsh> ---
>  drivers/media/platform/imagination/e5010-jpeg-enc.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/imagination/e5010-jpeg-enc.c b/drivers/media/platform/imagination/e5010-jpeg-enc.c
> index 420cb8bfdb12..49943bd604da 100644
> --- a/drivers/media/platform/imagination/e5010-jpeg-enc.c
> +++ b/drivers/media/platform/imagination/e5010-jpeg-enc.c
> @@ -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_register;
>  	}
>  
>  	v4l2_info(&e5010->v4l2_dev, "Device registered as /dev/video%d\n",
> @@ -1112,9 +1112,8 @@ static int e5010_probe(struct platform_device *pdev)
>  
>  	return 0;
>  
> -fail_after_video_register_device:
> -	v4l2_m2m_release(e5010->m2m_dev);
>  fail_after_v4l2_register:
> +	v4l2_m2m_release(e5010->m2m_dev);
>  	v4l2_device_unregister(&e5010->v4l2_dev);
>  fail_after_video_device_alloc:
>  	video_device_release(e5010->vdev);


      parent reply	other threads:[~2026-11-05 14:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03  9:46 Wentao Liang
2026-11-03 10:26 ` Krzysztof Kozlowski
2026-11-05 14:24 ` Thakkar, Devarsh [this message]

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=d1cce550-6d23-48d7-8ef5-cc5103d52804@ti.com \
    --to=devarsht@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=vulab@iscas.ac.cn \
    /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®