Skip to content

Commit 467e00b

Browse files
ColinIanKingalexdeucher
authored andcommitted
drm/amd/amdgpu: Fix missing error return on kzalloc failure
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: 4fb9307 ("drm/amd/amdgpu: remove redundant host to psp cmd buf allocations") Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit 1ee9d1a)
1 parent 3ebf766 commit 467e00b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ static int psp_sw_init(struct amdgpu_ip_block *ip_block)
448448
psp->cmd = kzalloc(sizeof(struct psp_gfx_cmd_resp), GFP_KERNEL);
449449
if (!psp->cmd) {
450450
dev_err(adev->dev, "Failed to allocate memory to command buffer!\n");
451-
ret = -ENOMEM;
451+
return -ENOMEM;
452452
}
453453

454454
adev->psp.xgmi_context.supports_extended_data =

0 commit comments

Comments
 (0)