Re: [PATCH v2] drm/radeon: check bo_va->bo is non-NULL before using it

2024-06-28 Thread Pierre-Eric Pelloux-Prayer




Le 26/06/2024 à 15:59, Alex Deucher a écrit :

On Wed, Jun 26, 2024 at 6:54 AM Christian König
 wrote:


Am 25.06.24 um 19:44 schrieb Alex Deucher:

On Tue, Jun 25, 2024 at 10:32 AM Pierre-Eric Pelloux-Prayer
 wrote:

The call to radeon_vm_clear_freed might clear bo_va->bo, so
we have to check it before dereferencing it.

Signed-off-by: Pierre-Eric Pelloux-Prayer 

Acked-by: Alex Deucher 


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.


No it doesn't depend on anything in drm-misc. I'll push it to 
amd-staging-drm-next.


Pierre-Eric



Alex



Regards,
Christian.




---
   drivers/gpu/drm/radeon/radeon_gem.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_gem.c 
b/drivers/gpu/drm/radeon/radeon_gem.c
index 3fec3acdaf28..27225d1fe8d2 100644
--- a/drivers/gpu/drm/radeon/radeon_gem.c
+++ b/drivers/gpu/drm/radeon/radeon_gem.c
@@ -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





Re: [PATCH v2] drm/radeon: check bo_va->bo is non-NULL before using it

2024-06-26 Thread Alex Deucher
On Wed, Jun 26, 2024 at 6:54 AM Christian König
 wrote:
>
> Am 25.06.24 um 19:44 schrieb Alex Deucher:
> > On Tue, Jun 25, 2024 at 10:32 AM Pierre-Eric Pelloux-Prayer
> >  wrote:
> >> The call to radeon_vm_clear_freed might clear bo_va->bo, so
> >> we have to check it before dereferencing it.
> >>
> >> Signed-off-by: Pierre-Eric Pelloux-Prayer 
> >> 
> > Acked-by: Alex Deucher 
>
> 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

>
> Regards,
> Christian.
>
> >
> >> ---
> >>   drivers/gpu/drm/radeon/radeon_gem.c | 2 +-
> >>   1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/gpu/drm/radeon/radeon_gem.c 
> >> b/drivers/gpu/drm/radeon/radeon_gem.c
> >> index 3fec3acdaf28..27225d1fe8d2 100644
> >> --- a/drivers/gpu/drm/radeon/radeon_gem.c
> >> +++ b/drivers/gpu/drm/radeon/radeon_gem.c
> >> @@ -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
> >>
>


Re: [PATCH v2] drm/radeon: check bo_va->bo is non-NULL before using it

2024-06-26 Thread Christian König

Am 25.06.24 um 19:44 schrieb Alex Deucher:

On Tue, Jun 25, 2024 at 10:32 AM Pierre-Eric Pelloux-Prayer
 wrote:

The call to radeon_vm_clear_freed might clear bo_va->bo, so
we have to check it before dereferencing it.

Signed-off-by: Pierre-Eric Pelloux-Prayer 

Acked-by: Alex Deucher 


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.




---
  drivers/gpu/drm/radeon/radeon_gem.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_gem.c 
b/drivers/gpu/drm/radeon/radeon_gem.c
index 3fec3acdaf28..27225d1fe8d2 100644
--- a/drivers/gpu/drm/radeon/radeon_gem.c
+++ b/drivers/gpu/drm/radeon/radeon_gem.c
@@ -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





Re: [PATCH v2] drm/radeon: check bo_va->bo is non-NULL before using it

2024-06-25 Thread Alex Deucher
On Tue, Jun 25, 2024 at 10:32 AM Pierre-Eric Pelloux-Prayer
 wrote:
>
> The call to radeon_vm_clear_freed might clear bo_va->bo, so
> we have to check it before dereferencing it.
>
> Signed-off-by: Pierre-Eric Pelloux-Prayer 

Acked-by: Alex Deucher 

> ---
>  drivers/gpu/drm/radeon/radeon_gem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_gem.c 
> b/drivers/gpu/drm/radeon/radeon_gem.c
> index 3fec3acdaf28..27225d1fe8d2 100644
> --- a/drivers/gpu/drm/radeon/radeon_gem.c
> +++ b/drivers/gpu/drm/radeon/radeon_gem.c
> @@ -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
>


[PATCH v2] drm/radeon: check bo_va->bo is non-NULL before using it

2024-06-25 Thread Pierre-Eric Pelloux-Prayer
The call to radeon_vm_clear_freed might clear bo_va->bo, so
we have to check it before dereferencing it.

Signed-off-by: Pierre-Eric Pelloux-Prayer 
---
 drivers/gpu/drm/radeon/radeon_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_gem.c 
b/drivers/gpu/drm/radeon/radeon_gem.c
index 3fec3acdaf28..27225d1fe8d2 100644
--- a/drivers/gpu/drm/radeon/radeon_gem.c
+++ b/drivers/gpu/drm/radeon/radeon_gem.c
@@ -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