All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karol Herbst <kherbst@redhat.com>
To: dri-devel@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>,
	Karol Herbst <kherbst@redhat.com>
Subject: [PATCH 3/6] Revert "drm/ttm: Fix bo_global and mem_global kfree error"
Date: Tue, 16 Apr 2019 02:35:20 +0200	[thread overview]
Message-ID: <20190416003523.5069-4-kherbst@redhat.com> (raw)
In-Reply-To: <20190416003523.5069-1-kherbst@redhat.com>

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(+)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 57c89161b5c6..6941562ef2fa 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -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)
diff --git a/drivers/gpu/drm/ttm/ttm_memory.c b/drivers/gpu/drm/ttm/ttm_memory.c
index f1567c353b54..7704e17c402f 100644
--- a/drivers/gpu/drm/ttm/ttm_memory.c
+++ b/drivers/gpu/drm/ttm/ttm_memory.c
@@ -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,
 };
-- 
2.20.1

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

  parent reply	other threads:[~2019-04-16  0:35 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-16  0:35 [PATCH 0/6] Fix crash after reloading a driver using ttm Karol Herbst
2019-04-16  0:35 ` [PATCH 1/6] Revert "drm: Remove drm_global.{c,h} v2" Karol Herbst
2019-04-16  0:35 ` [PATCH 2/6] Revert "drm/ttm: initialize globals during device init (v2)" Karol Herbst
2019-04-16  0:35 ` Karol Herbst [this message]
2019-04-16  0:35 ` [PATCH 4/6] Revert "drm/ttm: use a static ttm_bo_global instance" Karol Herbst
2019-04-16  0:35 ` [PATCH 5/6] Revert "drm/ttm: make the device list mutex static" Karol Herbst
2019-04-16  0:35 ` [PATCH 6/6] Revert "drm/ttm: use a static ttm_mem_global instance" Karol Herbst
2019-04-16  6:38 ` [PATCH 0/6] Fix crash after reloading a driver using ttm Christian König
2019-04-16  9:10   ` Karol Herbst
2019-04-16  9:12     ` Koenig, Christian
2019-04-16 10:54       ` Karol Herbst
2019-04-16 11:06         ` Koenig, Christian
2019-04-16 11:20           ` Karol Herbst
2019-04-16 11:25             ` Christian König
2019-04-16 12:18           ` Daniel Vetter
2019-04-16 12:29             ` Koenig, Christian
2019-04-16 23:09   ` Eric Anholt
2019-04-17  0:10     ` Karol Herbst

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190416003523.5069-4-kherbst@redhat.com \
    --to=kherbst@redhat.com \
    --cc=alexander.deucher@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.