提交 f5ee92f0 编写于 作者: B Ben Skeggs

drm/nouveau/core: fail creation of zero-argument objects, when arguments are passed

Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
上级 3ee6f5b5
...@@ -67,15 +67,9 @@ _nouveau_object_ctor(struct nouveau_object *parent, ...@@ -67,15 +67,9 @@ _nouveau_object_ctor(struct nouveau_object *parent,
struct nouveau_oclass *oclass, void *data, u32 size, struct nouveau_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nouveau_object **pobject)
{ {
struct nouveau_object *object; if (size != 0)
int ret; return -ENOSYS;
return nouveau_object_create(parent, engine, oclass, 0, pobject);
ret = nouveau_object_create(parent, engine, oclass, 0, &object);
*pobject = nv_object(object);
if (ret)
return ret;
return 0;
} }
void void
...@@ -91,42 +85,24 @@ nouveau_object_destroy(struct nouveau_object *object) ...@@ -91,42 +85,24 @@ nouveau_object_destroy(struct nouveau_object *object)
kfree(object); kfree(object);
} }
static void
_nouveau_object_dtor(struct nouveau_object *object)
{
nouveau_object_destroy(object);
}
int int
nouveau_object_init(struct nouveau_object *object) nouveau_object_init(struct nouveau_object *object)
{ {
return 0; return 0;
} }
static int
_nouveau_object_init(struct nouveau_object *object)
{
return nouveau_object_init(object);
}
int int
nouveau_object_fini(struct nouveau_object *object, bool suspend) nouveau_object_fini(struct nouveau_object *object, bool suspend)
{ {
return 0; return 0;
} }
static int
_nouveau_object_fini(struct nouveau_object *object, bool suspend)
{
return nouveau_object_fini(object, suspend);
}
struct nouveau_ofuncs struct nouveau_ofuncs
nouveau_object_ofuncs = { nouveau_object_ofuncs = {
.ctor = _nouveau_object_ctor, .ctor = _nouveau_object_ctor,
.dtor = _nouveau_object_dtor, .dtor = nouveau_object_destroy,
.init = _nouveau_object_init, .init = nouveau_object_init,
.fini = _nouveau_object_fini, .fini = nouveau_object_fini,
}; };
int int
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册