All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/radeon: avoid potential null pointer access
@ 2021-03-30 14:04 Guchun Chen
  2021-03-30 14:22 ` Christian König
  0 siblings, 1 reply; 2+ messages in thread
From: Guchun Chen @ 2021-03-30 14:04 UTC (permalink / raw)
  To: amd-gfx, christian.koenig; +Cc: Guchun Chen

Leverage the same logic from amdgpu_ttm_tt_unpin_userptr.

Signed-off-by: Guchun Chen <guchun.chen@amd.com>
---
 drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index 37ac42d6740f..2a61cff325e4 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -415,7 +415,7 @@ static void radeon_ttm_tt_unpin_userptr(struct ttm_device *bdev, struct ttm_tt *
 		DMA_BIDIRECTIONAL : DMA_TO_DEVICE;
 
 	/* double check that we don't free the table twice */
-	if (!ttm->sg->sgl)
+	if (!ttm->sg || !ttm->sg->sgl)
 		return;
 
 	/* free the sg table and pages again */
-- 
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/radeon: avoid potential null pointer access
  2021-03-30 14:04 [PATCH] drm/radeon: avoid potential null pointer access Guchun Chen
@ 2021-03-30 14:22 ` Christian König
  0 siblings, 0 replies; 2+ messages in thread
From: Christian König @ 2021-03-30 14:22 UTC (permalink / raw)
  To: Guchun Chen, amd-gfx

Am 30.03.21 um 16:04 schrieb Guchun Chen:
> Leverage the same logic from amdgpu_ttm_tt_unpin_userptr.
>
> Signed-off-by: Guchun Chen <guchun.chen@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
> index 37ac42d6740f..2a61cff325e4 100644
> --- a/drivers/gpu/drm/radeon/radeon_ttm.c
> +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
> @@ -415,7 +415,7 @@ static void radeon_ttm_tt_unpin_userptr(struct ttm_device *bdev, struct ttm_tt *
>   		DMA_BIDIRECTIONAL : DMA_TO_DEVICE;
>   
>   	/* double check that we don't free the table twice */
> -	if (!ttm->sg->sgl)
> +	if (!ttm->sg || !ttm->sg->sgl)
>   		return;
>   
>   	/* free the sg table and pages again */

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-30 14:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30 14:04 [PATCH] drm/radeon: avoid potential null pointer access Guchun Chen
2021-03-30 14:22 ` Christian König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.