]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/amd/amdgpu: Fix missing error return on kzalloc failure
authorColin Ian King <colin.i.king@gmail.com>
Tue, 2 Sep 2025 12:40:50 +0000 (13:40 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 2 Sep 2025 19:57:10 +0000 (15:57 -0400)
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@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

index 1d6e1d5de8fa434bafb08398cbcd1dc40cded1c9..3696f48c233b5ca62b9f51b7a91f9ccf048b6856 100644 (file)
@@ -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 =