[PATCH 2/3] drm/qxl: fix gaping memory hole

Maarten Lankhorst maarten.lankhorst at canonical.com
Wed Sep 3 08:12:22 PDT 2014


This is how you implement a sieve in a driver. ;-)

Signed-off-by: Maarten Lankhorst <maarten.lankhorst at canonical.com>
---
 drivers/gpu/drm/qxl/qxl_release.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/qxl/qxl_release.c b/drivers/gpu/drm/qxl/qxl_release.c
index 828d47e90dce..29ab4ec44c40 100644
--- a/drivers/gpu/drm/qxl/qxl_release.c
+++ b/drivers/gpu/drm/qxl/qxl_release.c
@@ -162,12 +162,14 @@ static void
 qxl_release_free_list(struct qxl_release *release)
 {
 	while (!list_empty(&release->bos)) {
-		struct ttm_validate_buffer *entry;
+		struct qxl_bo_list *entry;
+		struct qxl_bo *bo;
 
 		entry = container_of(release->bos.next,
-				     struct ttm_validate_buffer, head);
-
-		list_del(&entry->head);
+				     struct qxl_bo_list, tv.head);
+		bo = to_qxl_bo(entry->tv.bo);
+		qxl_bo_unref(&bo);
+		list_del(&entry->tv.head);
 		kfree(entry);
 	}
 }
-- 
2.0.4




More information about the dri-devel mailing list