drm/amdgpu: check for allocation failure in amdgpu_vkms_sw_init()
Check whether the kcalloc() fails and return -ENOMEM if it does.
Fixes: 84ec374bd5
("drm/amdgpu: create amdgpu_vkms (v4)")
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
1b41d67ec9
commit
420c81c84b
@ -482,6 +482,8 @@ static int amdgpu_vkms_sw_init(void *handle)
|
||||
return r;
|
||||
|
||||
adev->amdgpu_vkms_output = kcalloc(adev->mode_info.num_crtc, sizeof(struct amdgpu_vkms_output), GFP_KERNEL);
|
||||
if (!adev->amdgpu_vkms_output)
|
||||
return -ENOMEM;
|
||||
|
||||
/* allocate crtcs, encoders, connectors */
|
||||
for (i = 0; i < adev->mode_info.num_crtc; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user