lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADnq5_Pbv+QHmFEeqV7HT1NY2zFnHAiZ4feb+=HSxoV5Rd=bSA@mail.gmail.com>
Date: Tue, 2 Sep 2025 10:36:24 -0400
From: Alex Deucher <alexdeucher@...il.com>
To: Colin Ian King <colin.i.king@...il.com>
Cc: Alex Deucher <alexander.deucher@....com>, 
	Christian König <christian.koenig@....com>, 
	David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>, 
	Hawking Zhang <Hawking.Zhang@....com>, Lijo Lazar <lijo.lazar@....com>, 
	Sunil Khatri <sunil.khatri@....com>, John Clements <john.clements@....com>, 
	amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org, 
	kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH][next] drm/amd/amdgpu: Fix missing error return on kzalloc failure

Applied.  Thanks!

Alex

On Tue, Sep 2, 2025 at 8:49 AM Colin Ian King <colin.i.king@...il.com> wrote:
>
> Currently the kzalloc failure check just sets reports the failure
> and sets the variable ret to -ENOMEM, which is not checked later
> for this specific error. Fix this by just returning -ENOMEM rather
> than setting ret.
>
> Fixes: 4fb930715468 ("drm/amd/amdgpu: remove redundant host to psp cmd buf allocations")
> Signed-off-by: Colin Ian King <colin.i.king@...il.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index 1d6e1d5de8fa..3696f48c233b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -448,7 +448,7 @@ static int psp_sw_init(struct amdgpu_ip_block *ip_block)
>         psp->cmd = kzalloc(sizeof(struct psp_gfx_cmd_resp), GFP_KERNEL);
>         if (!psp->cmd) {
>                 dev_err(adev->dev, "Failed to allocate memory to command buffer!\n");
> -               ret = -ENOMEM;
> +               return -ENOMEM;
>         }
>
>         adev->psp.xgmi_context.supports_extended_data =
> --
> 2.51.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ