mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 10:49:33 +00:00
drm/nouveau/ttm: don't dereference nvbo::cli, it can outlive client
Potentially responsible for some random OOPSes. Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Cc: stable@vger.kernel.org [v4.15+]
This commit is contained in:
parent
a02cbe2e34
commit
0d5a03c3d9
3 changed files with 3 additions and 6 deletions
|
@ -214,7 +214,6 @@ nouveau_bo_new(struct nouveau_cli *cli, u64 size, int align,
|
||||||
INIT_LIST_HEAD(&nvbo->entry);
|
INIT_LIST_HEAD(&nvbo->entry);
|
||||||
INIT_LIST_HEAD(&nvbo->vma_list);
|
INIT_LIST_HEAD(&nvbo->vma_list);
|
||||||
nvbo->bo.bdev = &drm->ttm.bdev;
|
nvbo->bo.bdev = &drm->ttm.bdev;
|
||||||
nvbo->cli = cli;
|
|
||||||
|
|
||||||
/* This is confusing, and doesn't actually mean we want an uncached
|
/* This is confusing, and doesn't actually mean we want an uncached
|
||||||
* mapping, but is what NOUVEAU_GEM_DOMAIN_COHERENT gets translated
|
* mapping, but is what NOUVEAU_GEM_DOMAIN_COHERENT gets translated
|
||||||
|
|
|
@ -26,8 +26,6 @@ struct nouveau_bo {
|
||||||
|
|
||||||
struct list_head vma_list;
|
struct list_head vma_list;
|
||||||
|
|
||||||
struct nouveau_cli *cli;
|
|
||||||
|
|
||||||
unsigned contig:1;
|
unsigned contig:1;
|
||||||
unsigned page:5;
|
unsigned page:5;
|
||||||
unsigned kind:8;
|
unsigned kind:8;
|
||||||
|
|
|
@ -63,7 +63,7 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man,
|
||||||
struct ttm_mem_reg *reg)
|
struct ttm_mem_reg *reg)
|
||||||
{
|
{
|
||||||
struct nouveau_bo *nvbo = nouveau_bo(bo);
|
struct nouveau_bo *nvbo = nouveau_bo(bo);
|
||||||
struct nouveau_drm *drm = nvbo->cli->drm;
|
struct nouveau_drm *drm = nouveau_bdev(bo->bdev);
|
||||||
struct nouveau_mem *mem;
|
struct nouveau_mem *mem;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ nouveau_gart_manager_new(struct ttm_mem_type_manager *man,
|
||||||
struct ttm_mem_reg *reg)
|
struct ttm_mem_reg *reg)
|
||||||
{
|
{
|
||||||
struct nouveau_bo *nvbo = nouveau_bo(bo);
|
struct nouveau_bo *nvbo = nouveau_bo(bo);
|
||||||
struct nouveau_drm *drm = nvbo->cli->drm;
|
struct nouveau_drm *drm = nouveau_bdev(bo->bdev);
|
||||||
struct nouveau_mem *mem;
|
struct nouveau_mem *mem;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ nv04_gart_manager_new(struct ttm_mem_type_manager *man,
|
||||||
struct ttm_mem_reg *reg)
|
struct ttm_mem_reg *reg)
|
||||||
{
|
{
|
||||||
struct nouveau_bo *nvbo = nouveau_bo(bo);
|
struct nouveau_bo *nvbo = nouveau_bo(bo);
|
||||||
struct nouveau_drm *drm = nvbo->cli->drm;
|
struct nouveau_drm *drm = nouveau_bdev(bo->bdev);
|
||||||
struct nouveau_mem *mem;
|
struct nouveau_mem *mem;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue