]> git.itanic.dy.fi Git - linux-stable/commitdiff
drm/amdgpu: return an error if query_video_caps is not set
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 29 Jun 2023 13:14:32 +0000 (09:14 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 7 Jul 2023 17:51:47 +0000 (13:51 -0400)
Should only be an issue for bring up when the function
pointer is not set, but check it anyway to be safe.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c

index cca5a495611f3ba1454d0ecfb231618f64e019cb..85a0d5f419c87698f75532ce2a476ff2428889b9 100644 (file)
@@ -1102,6 +1102,9 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
                struct drm_amdgpu_info_video_caps *caps;
                int r;
 
+               if (!adev->asic_funcs->query_video_codecs)
+                       return -EINVAL;
+
                switch (info->video_cap.type) {
                case AMDGPU_INFO_VIDEO_CAPS_DECODE:
                        r = amdgpu_asic_query_video_codecs(adev, false, &codecs);