@@ -1528,6 +1528,7 @@ static void ttm_bo_global_kobj_release(struct kobject *kobj)
container_of(kobj, struct ttm_bo_global, kobj);
__free_page(glob->dummy_read_page);
+ kfree(glob);
}
void ttm_bo_global_release(void)
@@ -219,6 +219,14 @@ static ssize_t ttm_mem_global_store(struct kobject *kobj,
return size;
}
+static void ttm_mem_global_kobj_release(struct kobject *kobj)
+{
+ struct ttm_mem_global *glob =
+ container_of(kobj, struct ttm_mem_global, kobj);
+
+ kfree(glob);
+}
+
static struct attribute *ttm_mem_global_attrs[] = {
&ttm_mem_global_lower_mem_limit,
NULL
@@ -230,6 +238,7 @@ static const struct sysfs_ops ttm_mem_global_ops = {
};
static struct kobj_type ttm_mem_glob_kobj_type = {
+ .release = &ttm_mem_global_kobj_release,
.sysfs_ops = &ttm_mem_global_ops,
.default_attrs = ttm_mem_global_attrs,
};
This reverts commit 30f33126feca0fe16df9e9302ffc28a953e2eb37. Signed-off-by: Karol Herbst <kherbst@redhat.com> --- drivers/gpu/drm/ttm/ttm_bo.c | 1 + drivers/gpu/drm/ttm/ttm_memory.c | 9 +++++++++ 2 files changed, 10 insertions(+)