* [PATCH] media: chips-media: wave5: fix a potential memory leak in wave5_vdi_init()
@ 2026-01-25 14:19 Haoxiang Li
2026-01-25 14:27 ` Greg KH
2026-03-19 17:43 ` Nicolas Dufresne
0 siblings, 2 replies; 3+ messages in thread
From: Haoxiang Li @ 2026-01-25 14:19 UTC (permalink / raw)
To: jackson.lee, mchehab, bob.beckett, sebastian.fricke,
dafna.hirschfeld, nicolas.dufresne
Cc: linux-media, linux-kernel, Haoxiang Li, stable
Add wave5_vdi_free_dma_memory() in the error path of
wave5_vdi_init() to prevent a potential memory leak.
Fixes: 45d1a2b93277 ("media: chips-media: wave5: Add vpuapi layer")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
---
drivers/media/platform/chips-media/wave5/wave5-vdi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/media/platform/chips-media/wave5/wave5-vdi.c b/drivers/media/platform/chips-media/wave5/wave5-vdi.c
index bb13267ced38..8f71920a8a35 100644
--- a/drivers/media/platform/chips-media/wave5/wave5-vdi.c
+++ b/drivers/media/platform/chips-media/wave5/wave5-vdi.c
@@ -49,6 +49,7 @@ int wave5_vdi_init(struct device *dev)
if (!PRODUCT_CODE_W_SERIES(vpu_dev->product_code)) {
WARN_ONCE(1, "unsupported product code: 0x%x\n", vpu_dev->product_code);
+ wave5_vdi_free_dma_memory(vpu_dev, &vpu_dev->common_mem);
return -EOPNOTSUPP;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] media: chips-media: wave5: fix a potential memory leak in wave5_vdi_init()
2026-01-25 14:19 [PATCH] media: chips-media: wave5: fix a potential memory leak in wave5_vdi_init() Haoxiang Li
@ 2026-01-25 14:27 ` Greg KH
2026-03-19 17:43 ` Nicolas Dufresne
1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2026-01-25 14:27 UTC (permalink / raw)
To: Haoxiang Li
Cc: jackson.lee, mchehab, bob.beckett, sebastian.fricke,
dafna.hirschfeld, nicolas.dufresne, linux-media, linux-kernel,
stable
On Sun, Jan 25, 2026 at 10:19:15PM +0800, Haoxiang Li wrote:
> Add wave5_vdi_free_dma_memory() in the error path of
> wave5_vdi_init() to prevent a potential memory leak.
>
> Fixes: 45d1a2b93277 ("media: chips-media: wave5: Add vpuapi layer")
> Cc: stable@vger.kernel.org
> Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
> ---
> drivers/media/platform/chips-media/wave5/wave5-vdi.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/platform/chips-media/wave5/wave5-vdi.c b/drivers/media/platform/chips-media/wave5/wave5-vdi.c
> index bb13267ced38..8f71920a8a35 100644
> --- a/drivers/media/platform/chips-media/wave5/wave5-vdi.c
> +++ b/drivers/media/platform/chips-media/wave5/wave5-vdi.c
> @@ -49,6 +49,7 @@ int wave5_vdi_init(struct device *dev)
>
> if (!PRODUCT_CODE_W_SERIES(vpu_dev->product_code)) {
> WARN_ONCE(1, "unsupported product code: 0x%x\n", vpu_dev->product_code);
> + wave5_vdi_free_dma_memory(vpu_dev, &vpu_dev->common_mem);
> return -EOPNOTSUPP;
> }
>
> --
> 2.25.1
>
>
How was this found and tested?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] media: chips-media: wave5: fix a potential memory leak in wave5_vdi_init()
2026-01-25 14:19 [PATCH] media: chips-media: wave5: fix a potential memory leak in wave5_vdi_init() Haoxiang Li
2026-01-25 14:27 ` Greg KH
@ 2026-03-19 17:43 ` Nicolas Dufresne
1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Dufresne @ 2026-03-19 17:43 UTC (permalink / raw)
To: Haoxiang Li, jackson.lee, mchehab, bob.beckett, sebastian.fricke,
dafna.hirschfeld
Cc: linux-media, linux-kernel, stable
[-- Attachment #1: Type: text/plain, Size: 1319 bytes --]
Hi,
Le dimanche 25 janvier 2026 à 22:19 +0800, Haoxiang Li a écrit :
> Add wave5_vdi_free_dma_memory() in the error path of
> wave5_vdi_init() to prevent a potential memory leak.
>
> Fixes: 45d1a2b93277 ("media: chips-media: wave5: Add vpuapi layer")
> Cc: stable@vger.kernel.org
> Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
It would have been nice to reply to Greg, that being said, I carefully reviewed
and this effectively fix a leak in an error path. Description is brief but
sufficient in my opinion.
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> ---
> drivers/media/platform/chips-media/wave5/wave5-vdi.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/platform/chips-media/wave5/wave5-vdi.c b/drivers/media/platform/chips-media/wave5/wave5-vdi.c
> index bb13267ced38..8f71920a8a35 100644
> --- a/drivers/media/platform/chips-media/wave5/wave5-vdi.c
> +++ b/drivers/media/platform/chips-media/wave5/wave5-vdi.c
> @@ -49,6 +49,7 @@ int wave5_vdi_init(struct device *dev)
>
> if (!PRODUCT_CODE_W_SERIES(vpu_dev->product_code)) {
> WARN_ONCE(1, "unsupported product code: 0x%x\n", vpu_dev->product_code);
> + wave5_vdi_free_dma_memory(vpu_dev, &vpu_dev->common_mem);
> return -EOPNOTSUPP;
> }
>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-03-19 17:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-25 14:19 [PATCH] media: chips-media: wave5: fix a potential memory leak in wave5_vdi_init() Haoxiang Li
2026-01-25 14:27 ` Greg KH
2026-03-19 17:43 ` Nicolas Dufresne
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox