The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jon Hunter <jonathanh@nvidia.com>
To: cgel.zte@gmail.com, thierry.reding@gmail.com
Cc: airlied@linux.ie, daniel@ffwll.ch,
	dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org,
	linux-kernel@vger.kernel.org, Lv Ruyi <lv.ruyi@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH] drm: tegra: fix memory leak in error handling path
Date: Tue, 29 Mar 2022 11:55:38 +0100	[thread overview]
Message-ID: <b70d47e7-5e1b-a23f-80af-eaa255a103e3@nvidia.com> (raw)
In-Reply-To: <20220329103747.2376753-1-lv.ruyi@zte.com.cn>


On 29/03/2022 11:37, cgel.zte@gmail.com wrote:
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
> 
> Before leave the nvdec_load_firmware, we shuold free virt which is alloced

s/shuold/should
s/alloced/allocated

> by dma_alloc_coherent, so change "return err" to "goto cleanup".
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
> ---
>   drivers/gpu/drm/tegra/nvdec.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/tegra/nvdec.c b/drivers/gpu/drm/tegra/nvdec.c
> index 79e1e88203cf..a14863346bfa 100644
> --- a/drivers/gpu/drm/tegra/nvdec.c
> +++ b/drivers/gpu/drm/tegra/nvdec.c
> @@ -209,7 +209,7 @@ static int nvdec_load_firmware(struct nvdec *nvdec)
>   
>   		err = dma_mapping_error(nvdec->dev, iova);
>   		if (err < 0)
> -			return err;
> +			goto cleanup;


Actually, I think that the correct fix here would be the same as what 
was done for VIC ...

https://lore.kernel.org/linux-mm/6b86f6e530b504a5eee864af10e2ae1570d7b645.1639157090.git.robin.murphy@arm.com/

Jon

-- 
nvpublic

      reply	other threads:[~2022-03-29 10:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-29 10:37 [PATCH] drm: tegra: fix memory leak in error handling path cgel.zte
2022-03-29 10:55 ` Jon Hunter [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=b70d47e7-5e1b-a23f-80af-eaa255a103e3@nvidia.com \
    --to=jonathanh@nvidia.com \
    --cc=airlied@linux.ie \
    --cc=cgel.zte@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=lv.ruyi@zte.com.cn \
    --cc=thierry.reding@gmail.com \
    --cc=zealci@zte.com.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