diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-08-03 08:22:53 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-08-03 23:41:05 -0400 |
commit | c96e7c7a3a79931446ecf9494a8415e4d164ebd8 (patch) | |
tree | 5c809a9214cb85b862b0e2c24b6e21c422dd128e /drivers/gpu | |
parent | fa99239cb73dbf419bea9f334b85ba94ac88a532 (diff) |
drm/ttm: Read buffer overflow
Check whether index is within bounds before grabbing the element.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index aa82d5370c38..c2b0d710d10f 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c | |||
@@ -1182,13 +1182,14 @@ static int ttm_bo_force_list_clean(struct ttm_bo_device *bdev, | |||
1182 | 1182 | ||
1183 | int ttm_bo_clean_mm(struct ttm_bo_device *bdev, unsigned mem_type) | 1183 | int ttm_bo_clean_mm(struct ttm_bo_device *bdev, unsigned mem_type) |
1184 | { | 1184 | { |
1185 | struct ttm_mem_type_manager *man = &bdev->man[mem_type]; | 1185 | struct ttm_mem_type_manager *man; |
1186 | int ret = -EINVAL; | 1186 | int ret = -EINVAL; |
1187 | 1187 | ||
1188 | if (mem_type >= TTM_NUM_MEM_TYPES) { | 1188 | if (mem_type >= TTM_NUM_MEM_TYPES) { |
1189 | printk(KERN_ERR TTM_PFX "Illegal memory type %d\n", mem_type); | 1189 | printk(KERN_ERR TTM_PFX "Illegal memory type %d\n", mem_type); |
1190 | return ret; | 1190 | return ret; |
1191 | } | 1191 | } |
1192 | man = &bdev->man[mem_type]; | ||
1192 | 1193 | ||
1193 | if (!man->has_type) { | 1194 | if (!man->has_type) { |
1194 | printk(KERN_ERR TTM_PFX "Trying to take down uninitialized " | 1195 | printk(KERN_ERR TTM_PFX "Trying to take down uninitialized " |