Skip to content

Commit

Permalink
drm/ttm: Read buffer overflow
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Roel Kluin authored and Dave Airlie committed Aug 4, 2009
1 parent fa99239 commit c96e7c7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/ttm/ttm_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1182,13 +1182,14 @@ static int ttm_bo_force_list_clean(struct ttm_bo_device *bdev,

int ttm_bo_clean_mm(struct ttm_bo_device *bdev, unsigned mem_type)
{
struct ttm_mem_type_manager *man = &bdev->man[mem_type];
struct ttm_mem_type_manager *man;
int ret = -EINVAL;

if (mem_type >= TTM_NUM_MEM_TYPES) {
printk(KERN_ERR TTM_PFX "Illegal memory type %d\n", mem_type);
return ret;
}
man = &bdev->man[mem_type];

if (!man->has_type) {
printk(KERN_ERR TTM_PFX "Trying to take down uninitialized "
Expand Down

0 comments on commit c96e7c7

Please sign in to comment.