drm/radeon: check bo_va->bo is non-NULL before using it
Subsystems (2)
PATCH v2 1/1 drm/radeon: check bo_va->bo is non-NULL before using it
The call to radeon_vm_clear_freed might clear bo_va->bo, so we have to check it before dereferencing it.
--- drivers/gpu/drm/radeon/radeon_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_gem.c +1 -1
@@ -641,7 +641,7 @@ static void radeon_gem_va_update_vm(struct radeon_device *rdev,if (r) goto error_unlock; -if (bo_va->it.start) +if (bo_va->it.start && bo_va->bo) r =radeon_vm_bo_update (rdev, bo_va, bo_va->bo->tbo.resource); error_unlock:
Signature · 1 line
2.45.2
Quoted 5 lines · Pierre-Eric Pelloux-Prayer
The call to
radeon_vm_clear_freedmight clearbo_va->bo, so we have to check it before dereferencing it.Signed-off-by Pierre-Eric Pelloux-Prayer <[email protected]>
Quoted 20 lines
--- drivers/gpu/drm/radeon/radeon_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/radeon/radeon_gem.c +1
-2@@ -641,7 +641,7 @@ static void radeon_gem_va_update_vm(struct radeon_device *rdev,if (r) goto error_unlock; -if (bo_va->it.start) +if (bo_va->it.start && bo_va->bo) r =radeon_vm_bo_update (rdev, bo_va, bo_va->bo->tbo.resource); error_unlock: --2.45.2
Christian König
maintainerAm 25.06.24 um 19:44 schrieb Alex Deucher:
Quoted 7 lines
Quoted 4 lines · Pierre-Eric Pelloux-Prayer
The call to
radeon_vm_clear_freedmight clearbo_va->bo, so we have to check it before dereferencing it.Signed-off-by Pierre-Eric Pelloux-Prayer <[email protected]>Acked-by Alex Deucher <[email protected]>
Should I push this to drm-misc-fixes or should Pierre push it to amd-staging-drm-next?
Might take some minor work from you when you start to handle radeon change as well.
Regards,
Christian.
Quoted 21 lines
Quoted 21 lines
--- drivers/gpu/drm/radeon/radeon_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/radeon/radeon_gem.c +1
-2@@ -641,7 +641,7 @@ static void radeon_gem_va_update_vm(struct radeon_device *rdev,if (r) goto error_unlock; -if (bo_va->it.start) +if (bo_va->it.start && bo_va->bo) r =radeon_vm_bo_update (rdev, bo_va, bo_va->bo->tbo.resource); error_unlock: --2.45.2
Quoted 7 lines · Christian König
Am 25.06.24 um 19:44 schrieb Alex Deucher:
Quoted 5 lines
Quoted 3 lines · Pierre-Eric Pelloux-Prayer
The call to
radeon_vm_clear_freedmight clearbo_va->bo, so we have to check it before dereferencing it.
Quoted 8 lines
Quoted 2 lines
Quoted 1 line
Signed-off-by Pierre-Eric Pelloux-Prayer <[email protected]>Acked-by Alex Deucher <[email protected]>Should I push this to drm-misc-fixes or should Pierre push it to amd-staging-drm-next?
Might take some minor work from you when you start to handle radeon change as well.
Does this depend on anything in drm-misc? Otherwise, I can just take it via the standard channels. I already handle radeon patches via the amd tree.
Alex
Quoted 26 lines
Regards,
Christian.Quoted 21 lines
Quoted 21 lines
--- drivers/gpu/drm/radeon/radeon_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/radeon/radeon_gem.c +1
-2@@ -641,7 +641,7 @@ static void radeon_gem_va_update_vm(struct radeon_device *rdev,if (r) goto error_unlock; -if (bo_va->it.start) +if (bo_va->it.start && bo_va->bo) r =radeon_vm_bo_update (rdev, bo_va, bo_va->bo->tbo.resource); error_unlock: --2.45.2
Le 26/06/2024 à 15:59, Alex Deucher a écrit :
Quoted 15 lines
Quoted 13 lines · Christian König
Am 25.06.24 um 19:44 schrieb Alex Deucher:
Quoted 7 lines
Quoted 4 lines · Pierre-Eric Pelloux-Prayer
The call to
radeon_vm_clear_freedmight clearbo_va->bo, so we have to check it before dereferencing it.Signed-off-by Pierre-Eric Pelloux-Prayer <[email protected]>Acked-by Alex Deucher <[email protected]>Should I push this to drm-misc-fixes or should Pierre push it to amd-staging-drm-next?
Quoted 6 lines
Quoted 2 lines
Might take some minor work from you when you start to handle radeon change as well.
Does this depend on anything in drm-misc? Otherwise, I can just take it via the standard channels. I already handle radeon patches via the amd tree.
No it doesn't depend on anything in drm-misc. I'll push it to amd-staging-drm-next.
Pierre-Eric
Quoted 29 lines
Alex
Quoted 26 lines
Regards,
Christian.Quoted 21 lines
Quoted 21 lines
--- drivers/gpu/drm/radeon/radeon_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/radeon/radeon_gem.c +1
-2@@ -641,7 +641,7 @@ static void radeon_gem_va_update_vm(struct radeon_device *rdev,if (r) goto error_unlock; -if (bo_va->it.start) +if (bo_va->it.start && bo_va->bo) r =radeon_vm_bo_update (rdev, bo_va, bo_va->bo->tbo.resource); error_unlock: --2.45.2