mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-25 16:11:45 +00:00
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>
This commit is contained in:
parent
fa99239cb7
commit
c96e7c7a3a
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
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;
|
int ret = -EINVAL;
|
||||||
|
|
||||||
if (mem_type >= TTM_NUM_MEM_TYPES) {
|
if (mem_type >= TTM_NUM_MEM_TYPES) {
|
||||||
printk(KERN_ERR TTM_PFX "Illegal memory type %d\n", mem_type);
|
printk(KERN_ERR TTM_PFX "Illegal memory type %d\n", mem_type);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
man = &bdev->man[mem_type];
|
||||||
|
|
||||||
if (!man->has_type) {
|
if (!man->has_type) {
|
||||||
printk(KERN_ERR TTM_PFX "Trying to take down uninitialized "
|
printk(KERN_ERR TTM_PFX "Trying to take down uninitialized "
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue