Re: [PATCH 1/2] drm/ttm: set ttm_buffer_object pointer as null after it's freed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ray,

well those patches doesn't make sense, the pointer is only local to the function.

Regards,
Christian.

Am 10.09.2018 um 10:57 schrieb Huang Rui:
It avoids to be refered again after freed.

Signed-off-by: Huang Rui <ray.huang@xxxxxxx>
Cc: Christian König <christian.koenig@xxxxxxx>
Cc: Tom StDenis <Tom.StDenis@xxxxxxx>
---
  drivers/gpu/drm/ttm/ttm_bo.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 138c989..d3ef5f8 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -54,6 +54,7 @@ static struct attribute ttm_bo_count = {
  static void ttm_bo_default_destroy(struct ttm_buffer_object *bo)
  {
  	kfree(bo);
+	bo = NULL;
  }
static inline int ttm_mem_type_from_place(const struct ttm_place *place,

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux