* [PATCH] media: imagination: Release m2m device on probe failure
@ 2026-11-03 9:46 Wentao Liang
2026-11-03 10:26 ` Krzysztof Kozlowski
2026-11-05 14:24 ` Thakkar, Devarsh
0 siblings, 2 replies; 3+ messages in thread
From: Wentao Liang @ 2026-11-03 9:46 UTC (permalink / raw)
To: Devarsh Thakkar, Mauro Carvalho Chehab
Cc: linux-media, linux-kernel, Wentao Liang, stable
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>
---
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);
--
2.34.1
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] media: imagination: Release m2m device on probe failure
2026-11-03 9:46 [PATCH] media: imagination: Release m2m device on probe failure Wentao Liang
@ 2026-11-03 10:26 ` Krzysztof Kozlowski
2026-11-05 14:24 ` Thakkar, Devarsh
1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2026-11-03 10:26 UTC (permalink / raw)
To: Wentao Liang
Cc: linux-media, Devarsh Thakkar, linux-kernel,
Mauro Carvalho Chehab, stable
On Tue, 03 Nov 2026 09:46:17 +0000, 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>
> ---
> drivers/media/platform/imagination/e5010-jpeg-enc.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
Multiple things here:
1. Your team ignored completely previous feedback. Multiple times.
2. You use multiple identities with this email address, thus I doubt that we
speak with an actual person.
3. Your bot does not even bother running checkpatch, right?
4. Nothing of this was reproduced nor tested.
5. Finally, the same feedback:
You sent multiple independent patches, to multiple independent
subsystems. The amount of these patches clearly suggest this was
AI generated and most likely not tested.
More importantly, you sent all this work without properly organizing
relevant patches into patchsets. This makes reviewing difficult
and might cause multiple reviewers to address the same issue.
Replying to the entire set is impossible and requires handling each
patch independently, instead of applying or discarding the set.
Maintainers also won't see the bigger picture of your work. Quite
worrying.
This is on the verge of hostile patch: bomb us with so many
contributions, we won't be able to handle them in efficient manner,
like responding ONCE to ask you to slow down. Considering all this
is untested and LLM generated, I have even more doubts whether this
should be considered for review.
Please read kernel documentation BEFORE posting more work. It will
explain you how to identify subsystems, how to organize your work per
subsystem (so a patchset grouping multiple patches with a short cover
letter), how to document the issue discovery method and what was
or was not tested.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] media: imagination: Release m2m device on probe failure
2026-11-03 9:46 [PATCH] media: imagination: Release m2m device on probe failure Wentao Liang
2026-11-03 10:26 ` Krzysztof Kozlowski
@ 2026-11-05 14:24 ` Thakkar, Devarsh
1 sibling, 0 replies; 3+ messages in thread
From: Thakkar, Devarsh @ 2026-11-05 14:24 UTC (permalink / raw)
To: Wentao Liang, Mauro Carvalho Chehab; +Cc: linux-media, linux-kernel, stable
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);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-05 14:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-03 9:46 [PATCH] media: imagination: Release m2m device on probe failure Wentao Liang
2026-11-03 10:26 ` Krzysztof Kozlowski
2026-11-05 14:24 ` Thakkar, Devarsh
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®