drm/nouveau: don't return freed object from nouveau_handle_create
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
parent
cfd376b6bf
commit
82c805abb2
1 changed files with 4 additions and 1 deletions
|
@ -109,7 +109,7 @@ nouveau_handle_create(struct nouveau_object *parent, u32 _parent, u32 _handle,
|
||||||
while (!nv_iclass(namedb, NV_NAMEDB_CLASS))
|
while (!nv_iclass(namedb, NV_NAMEDB_CLASS))
|
||||||
namedb = namedb->parent;
|
namedb = namedb->parent;
|
||||||
|
|
||||||
handle = *phandle = kzalloc(sizeof(*handle), GFP_KERNEL);
|
handle = kzalloc(sizeof(*handle), GFP_KERNEL);
|
||||||
if (!handle)
|
if (!handle)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
@ -146,6 +146,9 @@ nouveau_handle_create(struct nouveau_object *parent, u32 _parent, u32 _handle,
|
||||||
}
|
}
|
||||||
|
|
||||||
hprintk(handle, TRACE, "created\n");
|
hprintk(handle, TRACE, "created\n");
|
||||||
|
|
||||||
|
*phandle = handle;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue