Home Home > GIT Browse > openSUSE-15.1
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2019-01-10 15:58:26 +0100
committerThomas Zimmermann <tzimmermann@suse.de>2019-01-11 13:41:55 +0100
commit34bb1f2492b7f4dd918b4268a4afb6d801850b2e (patch)
tree2032cd048ae502c43f6e393114b47c08e9a45f9a
parentb47a5f2bef24bdc47c22b087ca4db30f4000afd2 (diff)
drm/amdgpu: fix integer overflow test in amdgpu_bo_list_create() (bsc#1113956)
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
index d472a2c8399f..b80243d3972e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
@@ -67,7 +67,8 @@ int amdgpu_bo_list_create(struct amdgpu_device *adev, struct drm_file *filp,
unsigned i;
int r;
- if (num_entries > SIZE_MAX / sizeof(struct amdgpu_bo_list_entry))
+ if (num_entries > (SIZE_MAX - sizeof(struct amdgpu_bo_list))
+ / sizeof(struct amdgpu_bo_list_entry))
return -EINVAL;
size = sizeof(struct amdgpu_bo_list);