aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-08-03 08:22:53 -0400
committerDave Airlie <airlied@redhat.com>2009-08-03 23:41:05 -0400
commitc96e7c7a3a79931446ecf9494a8415e4d164ebd8 (patch)
tree5c809a9214cb85b862b0e2c24b6e21c422dd128e /drivers/gpu
parentfa99239cb73dbf419bea9f334b85ba94ac88a532 (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.c3
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
1183int ttm_bo_clean_mm(struct ttm_bo_device *bdev, unsigned mem_type) 1183int 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 "