drm/qxl: fix gaping memory hole
authorMaarten Lankhorst <maarten.lankhorst@canonical.com>
Wed, 3 Sep 2014 15:01:28 +0000 (17:01 +0200)
committerMaarten Lankhorst <maarten.lankhorst@canonical.com>
Wed, 3 Sep 2014 15:09:12 +0000 (17:09 +0200)
This is how you implement a memory sieve in a driver. ;-)

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
drivers/gpu/drm/qxl/qxl_release.c

index 828d47e90dce69e1174903dde6ec39f209c1e7bf..29ab4ec44c40569e4da1a8244b4ee4a8504c2879 100644 (file)
@@ -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);
        }
 }