drm/nouveau: fix dma_address check for CPU/GPU sync
Subsystems (3)
PATCH 1/1 drm/nouveau: fix dma_address check for CPU/GPU sync
AGP for example doesn't have a dma_address array.
--- drivers/gpu/drm/nouveau/nouveau_bo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nouveau_bo.c +2 -2
@@ -546,7 +546,7 @@ nouveau_bo_sync_for_device(struct nouveau_bo *nvbo)struct ttm_tt *ttm_dma = (struct ttm_tt *)nvbo->bo.ttm;int i, j; -if (!ttm_dma) +if (!ttm_dma || !ttm_dma->dma_address)return ;if (!ttm_dma->pages) {NV_DEBUG (drm,"ttm_dma 0x%p: pages NULL\n" , ttm_dma);
@@ -582,7 +582,7 @@ nouveau_bo_sync_for_cpu(struct nouveau_bo *nvbo)struct ttm_tt *ttm_dma = (struct ttm_tt *)nvbo->bo.ttm;int i, j; -if (!ttm_dma) +if (!ttm_dma || !ttm_dma->dma_address)return ;if (!ttm_dma->pages) {NV_DEBUG (drm,"ttm_dma 0x%p: pages NULL\n" , ttm_dma);
Signature · 1 line
2.25.1
Quoted 3 lines · On Monday 14 June 2021 13:05:17 Christian König wrote:
AGP for example doesn't have a
dma_addressarray.Signed-off-by Christian König <[email protected]>
Fixes NULL pointer dereference in nouveau_bo_sync_for_device on AGP cards.
Quoted 26 lines
--- drivers/gpu/drm/nouveau/nouveau_bo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/nouveau/nouveau_bo.c +2
-2@@ -546,7 +546,7 @@ nouveau_bo_sync_for_device(struct nouveau_bo *nvbo)struct ttm_tt *ttm_dma = (struct ttm_tt *)nvbo->bo.ttm;int i, j; -if (!ttm_dma) +if (!ttm_dma || !ttm_dma->dma_address)return ;if (!ttm_dma->pages) {NV_DEBUG (drm,"ttm_dma 0x%p: pages NULL\n" , ttm_dma);@@ -582,7 +582,7 @@ nouveau_bo_sync_for_cpu(struct nouveau_bo *nvbo)struct ttm_tt *ttm_dma = (struct ttm_tt *)nvbo->bo.ttm;int i, j; -if (!ttm_dma) +if (!ttm_dma || !ttm_dma->dma_address)return ;if (!ttm_dma->pages) {NV_DEBUG (drm,"ttm_dma 0x%p: pages NULL\n" , ttm_dma);
Signature · 1 line
Ondrej Zary
Ping? Does anybody wants to give me an rb or acked-by?
AGP is basically broken on nouveu without this.
Christian.
Am 14.06.21 um 13:05 schrieb Christian König:
Quoted 29 lines
AGP for example doesn't have a
dma_addressarray.Signed-off-by Christian König <[email protected]>--- drivers/gpu/drm/nouveau/nouveau_bo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/nouveau/nouveau_bo.c +2
-2@@ -546,7 +546,7 @@ nouveau_bo_sync_for_device(struct nouveau_bo *nvbo)struct ttm_tt *ttm_dma = (struct ttm_tt *)nvbo->bo.ttm;int i, j; -if (!ttm_dma) +if (!ttm_dma || !ttm_dma->dma_address)return ;if (!ttm_dma->pages) {NV_DEBUG (drm,"ttm_dma 0x%p: pages NULL\n" , ttm_dma);@@ -582,7 +582,7 @@ nouveau_bo_sync_for_cpu(struct nouveau_bo *nvbo)struct ttm_tt *ttm_dma = (struct ttm_tt *)nvbo->bo.ttm;int i, j; -if (!ttm_dma) +if (!ttm_dma || !ttm_dma->dma_address)return ;if (!ttm_dma->pages) {NV_DEBUG (drm,"ttm_dma 0x%p: pages NULL\n" , ttm_dma);
Alex Deucher
Acked-byQuoted 4 lines · Christian König
Ping? Does anybody wants to give me an rb or acked-by?
AGP is basically broken on nouveu without this.
Looks correct to me.
Quoted 28 lines
Christian.
Am 14.06.21 um 13:05 schrieb Christian König:
Quoted 24 lines
AGP for example doesn't have a
dma_addressarray.Signed-off-by Christian König <[email protected]>--- drivers/gpu/drm/nouveau/nouveau_bo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/nouveau/nouveau_bo.c +1
-1@@ -546,7 +546,7 @@ nouveau_bo_sync_for_device(struct nouveau_bo *nvbo)struct ttm_tt *ttm_dma = (struct ttm_tt *)nvbo->bo.ttm;int i, j; -if (!ttm_dma) +if (!ttm_dma || !ttm_dma->dma_address)return ;if (!ttm_dma->pages) {NV_DEBUG (drm,"ttm_dma 0x%p: pages NULL\n" , ttm_dma);@@ -582,7 +582,7 @@ nouveau_bo_sync_for_cpu(struct nouveau_bo *nvbo)struct ttm_tt *ttm_dma = (struct ttm_tt *)nvbo->bo.ttm;int i, j;
Quoted 6 lines
drivers/gpu/drm/nouveau/nouveau_bo.c nouveau_bo_sync_for_device(struct nouveau_bo *nvbo) · line 552
Quoted 5 lines
drivers/gpu/drm/nouveau/nouveau_bo.c +1
-1-if (!ttm_dma) +if (!ttm_dma || !ttm_dma->dma_address)return ;if (!ttm_dma->pages) {NV_DEBUG (drm,"ttm_dma 0x%p: pages NULL\n" , ttm_dma);
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau