AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: "Srinivasan Shanmugam" <srinivasan.shanmugam@amd.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>
Cc: Lijo Lazar <lijo.lazar@amd.com>,
	Mario Limonciello <mario.limonciello@amd.com>,
	amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/amdgpu: Fix '*fw' from request_firmware() not released in 'amdgpu_ucode_request()'
Date: Thu, 4 Jan 2024 09:08:15 +0100	[thread overview]
Message-ID: <4847a2d1-967a-404d-bc6b-17cd4d24b116@gmail.com> (raw)
In-Reply-To: <20240104032358.2240226-1-srinivasan.shanmugam@amd.com>



Am 04.01.24 um 04:23 schrieb Srinivasan Shanmugam:
> Fixes the below:
> drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c:1404 amdgpu_ucode_request() warn: '*fw' from request_firmware() not released on lines: 1404.
>
> Cc: Mario Limonciello <mario.limonciello@amd.com>
> Cc: Lijo Lazar <lijo.lazar@amd.com>
> Cc: Christian König <christian.koenig@amd.com>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
> index b14127429f30..b8d000105816 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
> @@ -1401,6 +1401,9 @@ int amdgpu_ucode_request(struct amdgpu_device *adev, const struct firmware **fw,
>   	if (err)
>   		dev_dbg(adev->dev, "\"%s\" failed to validate\n", fw_name);
>   
> +	release_firmware(*fw);
> +	*fw = NULL;
> +

That doesn't looks even remotely correct. This code path is also taken 
when the validation succeeds.

Christian.

>   	return err;
>   }
>   


      reply	other threads:[~2024-01-04  8:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-04  3:23 [PATCH] drm/amdgpu: Fix '*fw' from request_firmware() not released in 'amdgpu_ucode_request()' Srinivasan Shanmugam
2024-01-04  8:08 ` Christian König [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=4847a2d1-967a-404d-bc6b-17cd4d24b116@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=lijo.lazar@amd.com \
    --cc=mario.limonciello@amd.com \
    --cc=srinivasan.shanmugam@amd.com \
    /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