Linux Media Controller development
 help / color / mirror / Atom feed
From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
To: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>,
	jackson.lee@chipsnmedia.com,  mchehab@kernel.org,
	bob.beckett@collabora.com, sebastian.fricke@collabora.com,
		dafna.hirschfeld@collabora.com
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	 stable@vger.kernel.org
Subject: Re: [PATCH] media: chips-media: wave5: fix a potential memory leak in wave5_vdi_init()
Date: Thu, 19 Mar 2026 13:43:58 -0400	[thread overview]
Message-ID: <604f619585e0c99e0d73a978260e053f3cd68b44.camel@collabora.com> (raw)
In-Reply-To: <20260125141915.2088123-1-lihaoxiang@isrc.iscas.ac.cn>

[-- 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 --]

      parent reply	other threads:[~2026-03-19 17:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 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=604f619585e0c99e0d73a978260e053f3cd68b44.camel@collabora.com \
    --to=nicolas.dufresne@collabora.com \
    --cc=bob.beckett@collabora.com \
    --cc=dafna.hirschfeld@collabora.com \
    --cc=jackson.lee@chipsnmedia.com \
    --cc=lihaoxiang@isrc.iscas.ac.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sebastian.fricke@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