Skip to content

Commit 17c1e41

Browse files
ColinIanKinggregkh
authored andcommitted
drm/amd/amdgpu: Fix missing error return on kzalloc failure
[ Upstream commit 467e00b ] 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 <colin.i.king@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 1ee9d1a) Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent e4de48e commit 17c1e41

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
@@ -447,7 +447,7 @@ static int psp_sw_init(struct amdgpu_ip_block *ip_block)
447447
psp->cmd = kzalloc(sizeof(struct psp_gfx_cmd_resp), GFP_KERNEL);
448448
if (!psp->cmd) {
449449
dev_err(adev->dev, "Failed to allocate memory to command buffer!\n");
450-
ret = -ENOMEM;
450+
return -ENOMEM;
451451
}
452452

453453
adev->psp.xgmi_context.supports_extended_data =

0 commit comments

Comments
 (0)