From 6778948f9de86c3cfaf36725a7c87dcff9ba247f Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Mon, 11 Dec 2023 08:20:59 +0000
Subject: [PATCH] kernel_5.10 no rt

---
 kernel/drivers/gpu/drm/nouveau/nvif/object.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/kernel/drivers/gpu/drm/nouveau/nvif/object.c b/kernel/drivers/gpu/drm/nouveau/nvif/object.c
index ef3f628..671a5c0 100644
--- a/kernel/drivers/gpu/drm/nouveau/nvif/object.c
+++ b/kernel/drivers/gpu/drm/nouveau/nvif/object.c
@@ -242,7 +242,7 @@
 }
 
 void
-nvif_object_fini(struct nvif_object *object)
+nvif_object_dtor(struct nvif_object *object)
 {
 	struct {
 		struct nvif_ioctl_v0 ioctl;
@@ -260,8 +260,8 @@
 }
 
 int
-nvif_object_init(struct nvif_object *parent, u32 handle, s32 oclass,
-		 void *data, u32 size, struct nvif_object *object)
+nvif_object_ctor(struct nvif_object *parent, const char *name, u32 handle,
+		 s32 oclass, void *data, u32 size, struct nvif_object *object)
 {
 	struct {
 		struct nvif_ioctl_v0 ioctl;
@@ -270,6 +270,7 @@
 	int ret = 0;
 
 	object->client = NULL;
+	object->name = name ? name : "nvifObject";
 	object->handle = handle;
 	object->oclass = oclass;
 	object->map.ptr = NULL;
@@ -277,9 +278,11 @@
 
 	if (parent) {
 		if (!(args = kmalloc(sizeof(*args) + size, GFP_KERNEL))) {
-			nvif_object_fini(object);
+			nvif_object_dtor(object);
 			return -ENOMEM;
 		}
+
+		object->parent = parent->parent;
 
 		args->ioctl.version = 0;
 		args->ioctl.type = NVIF_IOCTL_V0_NEW;
@@ -300,6 +303,6 @@
 	}
 
 	if (ret)
-		nvif_object_fini(object);
+		nvif_object_dtor(object);
 	return ret;
 }

--
Gitblit v1.6.2